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

Closed
opened 2026-01-31 07:32:45 +00:00 by claunia · 9 comments
Owner

Originally created by @muellerst-hg on GitHub (Jan 10, 2024).

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

Originally created by @muellerst-hg on GitHub (Jan 10, 2024). ### 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
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 07:32:45 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 10, 2024):

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.

@github-actions[bot] commented on GitHub (Jan 10, 2024): 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: - [CTRL + SHIFT + V Pasting In WSL Not Working (#264)](https://github.com/microsoft/terminal/issues/264), similarity score: 0.75 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@muellerst-hg commented on GitHub (Jan 10, 2024):

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

@muellerst-hg commented on GitHub (Jan 10, 2024): 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
Author
Owner

@zadjii-msft commented on GitHub (Jan 10, 2024):

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?

@zadjii-msft commented on GitHub (Jan 10, 2024): Could you share your [settings.json file](https://github.com/microsoft/terminal/wiki/Frequently-Asked-Questions-(FAQ)#where-can-i-find-the-settings-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?
Author
Owner

@muellerst-hg commented on GitHub (Jan 11, 2024):

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

@muellerst-hg commented on GitHub (Jan 11, 2024): > 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](https://github.com/microsoft/terminal/files/13899262/settings.json)
Author
Owner

@zadjii-msft commented on GitHub (Jan 11, 2024):

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/?

@zadjii-msft commented on GitHub (Jan 11, 2024): Huh, curious. I'd usually expect the user settings to include at least ```json "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 <kbd>shift</kbd> is in the opposite of it's actual state. As if <kbd>caps lock</kbd> was pressed or something. Does adding the ```json "actions": [ { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" } ] ``` binding at least fix `ctrl+shift+c` to copy/?
Author
Owner

@muellerst-hg commented on GitHub (Jan 11, 2024):

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?

@muellerst-hg commented on GitHub (Jan 11, 2024): > Does adding the > > ```json > "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?
Author
Owner

@muellerst-hg commented on GitHub (Jan 11, 2024):

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 commented on GitHub (Jan 11, 2024): I used [debug-tap](https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-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
Author
Owner

@muellerst-hg commented on GitHub (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.

@muellerst-hg commented on GitHub (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.
Author
Owner

@DHowett commented on GitHub (Jan 11, 2024):

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

@DHowett commented on GitHub (Jan 11, 2024): _A-ha!_ Thanks - that'll also help future searchers stumble on this issue. :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21087