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 + # not being processed by Bash correctly #3507

Closed
impguard opened this issue Nov 10, 2019 · 10 comments · Fixed by #4938
Closed

ctrl + # not being processed by Bash correctly #3507

impguard opened this issue Nov 10, 2019 · 10 comments · Fixed by #4938
Assignees
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@impguard
Copy link

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!

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 10, 2019
@Luuk34
Copy link

Luuk34 commented Nov 10, 2019

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

@zadjii-msft
Copy link
Member

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

@miniksa
Copy link
Member

miniksa commented 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.

@zadjii-msft zadjii-msft added Area-Input Related to input processing (key presses, mouse, etc.) Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 11, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 11, 2019
@zadjii-msft zadjii-msft added this to the Terminal v1.0 milestone Nov 11, 2019
@j4james
Copy link
Collaborator

j4james commented 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.

@zadjii-msft zadjii-msft added Area-VT Virtual Terminal sequence support and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Nov 12, 2019
@impguard
Copy link
Author

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": [
    ]
}

@Luuk34
Copy link

Luuk34 commented 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": []
}

@zadjii-msft
Copy link
Member

@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 zadjii-msft added Product-Conhost For issues in the Console codebase Priority-2 A description (P2) labels Nov 18, 2019
@daiyousei-qz
Copy link

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

@bolov
Copy link

bolov commented 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

@zadjii-msft zadjii-msft self-assigned this Mar 16, 2020
zadjii-msft added a commit that referenced this issue Mar 16, 2020
@ghost ghost added the In-PR This issue has a related PR label Mar 16, 2020
@ghost ghost closed this as completed in #4938 Mar 18, 2020
ghost pushed a commit that referenced this issue Mar 18, 2020
## Summary of the Pull Request

Fixes the <kbd>Ctrl+Num</kbd> keys in both conhost and the Terminal. These keys are supposed to be mapped to specific characters according to [this doc](https://vt100.net/docs/vt220-rm/table3-5.html). Now we actually handle them correctly.

## PR Checklist
* [x] Closes #3507 
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

* Ran test
* tested in `gnome-terminal` with `showkeys -a`
* tested in conhost with `showkeys -a`
* tested in Windows Terminal with `showkeys -a`
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Mar 18, 2020
DHowett-MSFT pushed a commit that referenced this issue Mar 19, 2020
## Summary of the Pull Request

Fixes the <kbd>Ctrl+Num</kbd> keys in both conhost and the Terminal. These keys are supposed to be mapped to specific characters according to [this doc](https://vt100.net/docs/vt220-rm/table3-5.html). Now we actually handle them correctly.

## PR Checklist
* [x] Closes #3507
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

* Ran test
* tested in `gnome-terminal` with `showkeys -a`
* tested in conhost with `showkeys -a`
* tested in Windows Terminal with `showkeys -a`

(cherry picked from commit f7d106d)
@ghost
Copy link

ghost commented Mar 20, 2020

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

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants