Skip to content

Stealth mode does not trigger on clipboard changes in WSLg #419

@LordLegend

Description

@LordLegend

Hi,

I’m experiencing a problem with the cht.sh command-line client’s stealth mode while running on WSL2 with WSLg. Clipboard polling works (I can use xsel --clipboard and receive Windows clipboard contents), and manual queries in cht.sh work as expected. However, when I enter stealth mode, copying text in Windows does not trigger any query or response in the terminal. There are no error messages displayed.

Steps to reproduce:

  1. Run WSL2 with WSLg on Windows 11.
  2. Run the latest cht.sh script:
    curl https://cht.sh/:cht.sh > ~/cht.sh
    chmod +x ~/cht.sh
    ~/cht.sh --shell
  3. Enter stealth mode at the cht.sh> prompt.
  4. Copy a short programming query (e.g., python list comprehension) in any Windows application.
  5. Observe that nothing happens in the terminal (no query triggered, no output).
  6. Confirm that xsel --clipboard in WSL shows the correct clipboard contents.

What I expected:

When I copy a short query in Windows, cht.sh should automatically fetch and display the answer in stealth mode.

What actually happens:

Nothing happens—no query is triggered, and the terminal remains idle. Manual queries work. No errors are shown.

Additional info:

  • WSL version: 2.5.9.0
  • Kernel version: 6.6.87.2-1
  • WSLg version: 1.0.66
  • Windows version: 10.0.26120.4452
  • Default shell: bash
  • Python version: 3.12.3
  • cht.sh is up to date as of 2025-06-25

First line of ~/cht.sh:

#!/bin/bash

Troubleshooting attempted:

  • Verified clipboard polling in Python (works as expected)
  • Installed both xsel and xclip
  • Tried running cht.sh in a clean shell environment
  • No custom .bashrc or .zshrc interfering
  • No error output observed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions