ctrl + # not being processed by Bash correctly #4906

Closed
opened 2026-01-30 23:59:54 +00:00 by claunia · 10 comments
Owner

Originally created by @impguard on GitHub (Nov 10, 2019).

Originally assigned to: @zadjii-msft on GitHub.

I'm sorry if this has been reported before, spent some time searching through the issues but couldn't find it.

Right now, if I type ctrl-NUM, it seems like it's not being picked up by the terminal app properly. Specifically, I've been trying to get the ctrl-6 vim behaviour to work, but I can't figure out if it's possible.

Thanks!

Originally created by @impguard on GitHub (Nov 10, 2019). Originally assigned to: @zadjii-msft on GitHub. I'm sorry if this has been reported before, spent some time searching through the issues but couldn't find it. Right now, if I type ctrl-NUM, it seems like it's not being picked up by the terminal app properly. Specifically, I've been trying to get the ctrl-6 vim behaviour to work, but I can't figure out if it's possible. Thanks!
Author
Owner

@Luuk34 commented on GitHub (Nov 10, 2019):

CTRL-6 does not seem to under CMD (with the Windows version of vim), and also not under WSL (Ubuntu).

@Luuk34 commented on GitHub (Nov 10, 2019): CTRL-6 does not seem to under CMD (with the Windows version of vim), and also not under WSL (Ubuntu).
Author
Owner

@zadjii-msft commented on GitHub (Nov 11, 2019):

Could you share your profiles.json? Also, are you pressing the numpad numbers, or the regular numbers?

@zadjii-msft commented on GitHub (Nov 11, 2019): Could you share your `profiles.json`? Also, are you pressing the _numpad_ numbers, or the regular numbers?
Author
Owner

@miniksa commented on GitHub (Nov 11, 2019):

We need to check if this is just physical numpad, the number key row, or both. Also how it works relative to the numpad key.

@miniksa commented on GitHub (Nov 11, 2019): We need to check if this is just physical numpad, the number key row, or both. Also how it works relative to the numpad key.
Author
Owner

@j4james commented on GitHub (Nov 11, 2019):

This is almost certainly the number key row. Digits 2 to 8 are supposed to generate some of the C0 control characters when combined with a Ctrl key. You can see the definitions here. I think the only one we support is Ctrl+2, and even that only works on some keyboards (doesn't work on my UK keyboard).

As far as I know, the numpad keys aren't meant to be affected by the Ctrl key (at least when NumLock is on). They don't work at all for us, which is isn't strictly correct, but that's less of an issue.

@j4james commented on GitHub (Nov 11, 2019): This is almost certainly the number key row. Digits 2 to 8 are supposed to generate some of the C0 control characters when combined with a `Ctrl` key. You can see the definitions [here](https://vt100.net/docs/vt220-rm/table3-5.html). I think the only one we support is `Ctrl+2`, and even that only works on some keyboards (doesn't work on my UK keyboard). As far as I know, the numpad keys aren't meant to be affected by the `Ctrl` key (at least when NumLock is on). They don't work at all for us, which is isn't strictly correct, but that's less of an issue.
Author
Owner

@impguard commented on GitHub (Nov 16, 2019):

Here's my profiles.json.

There's not much changed besides some look and feel.

And yes, it's the number key row.


// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation

{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",

    "profiles":
    [
        {
            // Make changes here to the powershell.exe profile
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "name": "Windows PowerShell",
            "commandline": "powershell.exe",
            "hidden": false
        },
        {
            // Make changes here to the cmd.exe profile
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "name": "cmd",
            "commandline": "cmd.exe",
            "hidden": false
        },
        {
            "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
            "hidden": false,
            "name": "Ubuntu-18.04",
            "source": "Windows.Terminal.Wsl",
            "colorScheme": "Solarized Dark",
            "cursorShape": "filledBox",
            "fontFace": "Consolas",
            "fontSize": 12,
            "historySize": 10000,
            "startingDirectory": "%USERPROFILE%"
        },
        {
            "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
            "hidden": false,
            "name": "Azure Cloud Shell",
            "source": "Windows.Terminal.Azure"
        }
    ],

    // Add custom color schemes to this array
    "schemes": [],

    // Add any keybinding overrides to this array.
    // To unbind a default keybinding, set the command to "unbound"
    "keybindings": [
    ]
}
@impguard commented on GitHub (Nov 16, 2019): Here's my profiles.json. There's not much changed besides some look and feel. And yes, it's the number key row. ``` // To view the default settings, hold "alt" while clicking on the "Settings" button. // For documentation on these settings, see: https://aka.ms/terminal-documentation { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", "profiles": [ { // Make changes here to the powershell.exe profile "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false }, { // Make changes here to the cmd.exe profile "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "cmd", "commandline": "cmd.exe", "hidden": false }, { "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", "hidden": false, "name": "Ubuntu-18.04", "source": "Windows.Terminal.Wsl", "colorScheme": "Solarized Dark", "cursorShape": "filledBox", "fontFace": "Consolas", "fontSize": 12, "historySize": 10000, "startingDirectory": "%USERPROFILE%" }, { "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", "hidden": false, "name": "Azure Cloud Shell", "source": "Windows.Terminal.Azure" } ], // Add custom color schemes to this array "schemes": [], // Add any keybinding overrides to this array. // To unbind a default keybinding, set the command to "unbound" "keybindings": [ ] } ```
Author
Owner

@Luuk34 commented on GitHub (Nov 17, 2019):

As i was intending to say, this has NOTHING to do with user-profiles. It is not working under different profiles so it's a problem of 'Windows Terminal' !

That why i am inserting my profile (BTW: its the default profile!):

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation

{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

    "profiles":
    [
        {
            // Make changes here to the powershell.exe profile
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "name": "Windows PowerShell",
            "commandline": "powershell.exe",
            "hidden": false
        },
        {
            // Make changes here to the cmd.exe profile
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "name": "cmd",
            "commandline": "cmd.exe",
            "hidden": false
        },
        {
            "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
            "hidden": false,
            "name": "Ubuntu",
            "source": "Windows.Terminal.Wsl"
        },
        {
            "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
            "hidden": false,
            "name": "Azure Cloud Shell",
            "source": "Windows.Terminal.Azure"
        }
    ],

    // Add custom color schemes to this array
    "schemes": [],

    // Add any keybinding overrides to this array.
    // To unbind a default keybinding, set the command to "unbound"
    "keybindings": []
}

@Luuk34 commented on GitHub (Nov 17, 2019): As i was intending to say, this has NOTHING to do with user-profiles. It is not working under different profiles so it's a problem of 'Windows Terminal' ! That why i am inserting my profile (BTW: its the default profile!): ``` // To view the default settings, hold "alt" while clicking on the "Settings" button. // For documentation on these settings, see: https://aka.ms/terminal-documentation { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": [ { // Make changes here to the powershell.exe profile "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false }, { // Make changes here to the cmd.exe profile "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "cmd", "commandline": "cmd.exe", "hidden": false }, { "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", "hidden": false, "name": "Ubuntu", "source": "Windows.Terminal.Wsl" }, { "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", "hidden": false, "name": "Azure Cloud Shell", "source": "Windows.Terminal.Azure" } ], // Add custom color schemes to this array "schemes": [], // Add any keybinding overrides to this array. // To unbind a default keybinding, set the command to "unbound" "keybindings": [] } ```
Author
Owner

@zadjii-msft commented on GitHub (Nov 18, 2019):

@j4james has it right - we should be using that table to send specific characters on C-#. This isn't really even a Windows Terminal problem, this is a conhost problem.

@zadjii-msft commented on GitHub (Nov 18, 2019): @j4james has it right - we should be using that table to send specific characters on <kbd>C-#</kbd>. This isn't really even a Windows Terminal problem, this is a _conhost_ problem.
Author
Owner

@daiyousei-qz commented on GitHub (Nov 24, 2019):

By the way, I'm using emacs with windows terminal and it seems emacs fails to detect key bindings like C-, C-. and .etc even after I have unbound them from shortcuts used by the terminal

@daiyousei-qz commented on GitHub (Nov 24, 2019): By the way, I'm using emacs with windows terminal and it seems emacs fails to detect key bindings like `C-,` `C-.` and .etc even after I have unbound them from shortcuts used by the terminal
Author
Owner

@bolov commented on GitHub (Mar 15, 2020):

A simple way to check if keys are sent through is to run od -c. CTRL+digit combinations don't work, even when unbounded in profiles.json

@bolov commented on GitHub (Mar 15, 2020): A simple way to check if keys are sent through is to run `od -c`. <kbd>CTRL+digit</kbd> combinations don't work, even when unbounded in `profiles.json`
Author
Owner

@ghost commented on GitHub (Mar 20, 2020):

:tada:This issue was addressed in #4938, which has now been successfully released as Windows Terminal Preview v0.10.781.0.🎉

Handy links:

@ghost commented on GitHub (Mar 20, 2020): :tada:This issue was addressed in #4938, which has now been successfully released as `Windows Terminal Preview v0.10.781.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.10.781.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4906