Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrl+shift+c and ctrl-d shortcuts do not work in WSL2 #16551

Closed
muellerst-hg opened this issue Jan 10, 2024 · 9 comments
Closed

ctrl+shift+c and ctrl-d shortcuts do not work in WSL2 #16551

muellerst-hg opened this issue Jan 10, 2024 · 9 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@muellerst-hg
Copy link

Windows Terminal version

1.18.3181.0

Windows build number

10.0.19045.3803

Other Software

WSL Debian

Steps to reproduce

Open WSL terminal
Selected text
Press ctrl-shift-c
Paste text into terminal
-> Result: no text is not copied

Using ctrl-c works

Same for ctrl-d:
Open WSL terminal
Press ctrl-d
-> Result: nothing happens

Expected Behavior

ctrl-shift-c copies a selected text
ctrl-d exits the terminal

Actual Behavior

ctrl-shift-c does not copiy a selected text
ctrl-d nothing happens

@muellerst-hg muellerst-hg added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jan 10, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@muellerst-hg
Copy link
Author

wsl --version
WSL-Version: 2.0.14.0
Kernelversion: 5.15.133.1-1
WSLg-Version: 1.0.59
MSRDC-Version: 1.2.4677
Direct3D-Version: 1.611.1-81528511
DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows-Version: 10.0.19045.3803

@zadjii-msft
Copy link
Member

Could you share your settings.json file/?

Are you running anything in WSL other than just your default shell? (bash/zsh/whatever)? Ultimately, that shell is supposed to be the one to handle Ctrl+D, but the Ctrl+Shift+C should be handled by the Terminal.

Actually come to think of it... what shell are you using?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 10, 2024
@muellerst-hg
Copy link
Author

Are you running anything in WSL other than just your default shell? (bash/zsh/whatever)? Ultimately, that shell is supposed to be the one to handle Ctrl+D, but the Ctrl+Shift+C should be handled by the Terminal.

Actually come to think of it... what shell are you using?

bash.

I tried to use ctrl-shift-c in powershell: same issue

The shortcuts worked before, then suddenly vanished.

settings.json

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 11, 2024
@zadjii-msft
Copy link
Member

Huh, curious. I'd usually expect the user settings to include at least

    "actions":
    [
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },
        { "command": "find", "keys": "ctrl+shift+f" },
        { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
    ]

But yours doesn't have any actions at all. That's totally fine, so long as that was intentional.

Maybe there's something else curious going on, where the Terminal thinks that shift is in the opposite of it's actual state. As if caps lock was pressed or something.

Does adding the

    "actions":
    [
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" }
    ]

binding at least fix ctrl+shift+c to copy/?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jan 11, 2024
@muellerst-hg
Copy link
Author

Does adding the

    "actions":
    [
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" }
    ]

binding at least fix ctrl+shift+c to copy/?

copying with ctrl+c works after adding the above lines. I also added ctrl+shift+x and it works. Tested on powershell as well as wsl bash.

Any idea what might interfere the shortcuts?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 11, 2024
@muellerst-hg
Copy link
Author

I used debug-tap to see if keystrokes are captured

␛[16;42;0;1;16;1_␛[16;42;0;0;0;1_␛[O
* `␛[16;42;0;1;16;1_␛[16;42;0;0;0;1_␛[O`
  * `Vk`: VK_SHIFT
  * `Sc`: 42
  * `Uc`: 0
  * `Kd`: down`
  * `Cs`: 16
␛[17;29;0;1;8;1_␛[17;29;0;0;0;1_␛[O
* `␛[17;29;0;1;8;1_␛[17;29;0;0;0;1_␛[O`
  * `Vk`: VK_CONTROL
  * `Sc`: 29
  * `Uc`: 0
  * `Kd`: down`
  * `Cs`: 8
␛[67;46;99;1;0;1_c␛[67;46;99;0;0;1_␛[O
* `␛[67;46;99;1;0;1_c␛[67;46;99;0;0;1_␛[O`
  * `Vk`: C key
  * `Sc`: 46
  * `Uc`: 'c'
  * `Kd`: down`
  * `Cs`: 0

To me this reads as if all three keystrokes are received from the terminal

@muellerst-hg
Copy link
Author

muellerst-hg commented Jan 11, 2024

I found the reason and I cannot resist to blame Cisco Webex client for inappropriate behaviour, capturing keystroke combinations in a selfish way even if it is running in the background.

@DHowett
Copy link
Member

DHowett commented Jan 11, 2024

A-ha! Thanks - that'll also help future searchers stumble on this issue. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

3 participants