Could you make switch ctrl and alt key function for signal, or vim shortcut key? #18423

Closed
opened 2026-01-31 06:13:30 +00:00 by claunia · 6 comments
Owner

Originally created by @CatCatCatDog on GitHub (Sep 12, 2022).

Description of the new feature/enhancement

Please, Could you make change ctrl to alt key function for signal, or vim shortcut key?

Proposed technical implementation details (optional)

Windows is almost use ctrl key Such as Ctrl+1, Ctrl+2, ctrl+c, ctrl+v, ctrl+l, ctrl+r.
This makes my little finger hurt for keep press ctrl key.
So, I used replace ctrl and alt keys on Windows.
Could you make switch ctrl and alt key function for signal, or vim shortcut key?
In Mac, iterm2 terminal is almost use cmd key for window function.
But, In order to signal, or vim shortcut key almost use control key.
This is very efficient.
If you make this function, Many people possible for string copy with ctrl + c key.
aa

Originally created by @CatCatCatDog on GitHub (Sep 12, 2022). # Description of the new feature/enhancement Please, Could you make change ctrl to alt key function for signal, or vim shortcut key? # Proposed technical implementation details (optional) Windows is almost use ctrl key Such as Ctrl+1, Ctrl+2, ctrl+c, ctrl+v, ctrl+l, ctrl+r. This makes my little finger hurt for keep press ctrl key. So, I used replace ctrl and alt keys on Windows. Could you make switch ctrl and alt key function for signal, or vim shortcut key? In Mac, iterm2 terminal is almost use cmd key for window function. But, In order to signal, or vim shortcut key almost use control key. This is very efficient. If you make this function, Many people possible for string copy with ctrl + c key. ![aa](https://user-images.githubusercontent.com/23658192/189564382-a3992e40-672a-408d-8557-f94b80c5feb4.png)
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 06:13:30 +00:00
Author
Owner

@DHowett commented on GitHub (Sep 12, 2022):

Thanks for posting! I'm not sure I understand the request. If you are asking us to allow you to change Ctrl to Alt inside Terminal, you can already do that today by changing the key bindings. They are in the JSON file and in the settings UI.

@DHowett commented on GitHub (Sep 12, 2022): Thanks for posting! I'm not sure I understand the request. If you are asking us to allow you to change Ctrl to Alt inside Terminal, you can already do that today by changing the key bindings. They are in the JSON file and in the settings UI.
Author
Owner

@CatCatCatDog commented on GitHub (Sep 12, 2022):

Yeah, I knew that. But, one key bindings impossible.
Or, If I'm wrong my configuration, Please tell me.

{ "command": { "action": "ctrl"}, "keys": "alt"},
{ "command": { "action": "alt"}, "keys": "ctl"},

{ "command": { "action":"keys", "keys":"ctrl"}, "keys": "alt"},
{ "command": { "action":"keys", "keys":"alt"}, "keys": "ctl"},

{ "keys":"ctrl", "keys": "alt" },
{ "keys":"alt", "keys": "ctrl" },

@CatCatCatDog commented on GitHub (Sep 12, 2022): Yeah, I knew that. But, one key bindings impossible. Or, If I'm wrong my configuration, Please tell me. { "command": { "action": "ctrl"}, "keys": "alt"}, { "command": { "action": "alt"}, "keys": "ctl"}, { "command": { "action":"keys", "keys":"ctrl"}, "keys": "alt"}, { "command": { "action":"keys", "keys":"alt"}, "keys": "ctl"}, { "keys":"ctrl", "keys": "alt" }, { "keys":"alt", "keys": "ctrl" },
Author
Owner

@zadjii-msft commented on GitHub (Sep 12, 2022):

I think I might still be missing something here.

Are you looking for a single keybinding to just replace all ctrl keys in keybindings, with alt/? So the Terminal's default bindings of

        { "command": { "action": "copy", "singleLine": false }, "keys": "ctrl+shift+c" },
        { "command": "selectAll", "keys": "ctrl+shift+a" },
        { "command": "scrollDown", "keys": "ctrl+shift+down" },
        { "command": { "action": "adjustFontSize", "delta": 1 }, "keys": "ctrl+plus" },

et al, would instead be replaced by:

        { "command": { "action": "copy", "singleLine": false }, "keys": "alt+shift+c" },
        { "command": "selectAll", "keys": "alt+shift+a" },
        { "command": "scrollDown", "keys": "alt+shift+down" },
        { "command": { "action": "adjustFontSize", "delta": 1 }, "keys": "alt+plus" },

?


OR

Are you looking for a setting to change the way the Terminal encodes ctrl/alt, so that pressing ctrl+key would instead send alt+key to the connected commandline application? (e.g. you'd need to press alt+z to send a ^Z to the client application)?


The first I don't think we'll be adding any time soon - you're more than welcome to change the bindings yourself in the settings.

The second I suppose is a viable feature request...

@zadjii-msft commented on GitHub (Sep 12, 2022): I think I might still be missing something here. Are you looking for a single keybinding to just replace all <kbd>ctrl</kbd> keys in keybindings, with <kbd>alt</kbd>/? So the Terminal's default bindings of ```json { "command": { "action": "copy", "singleLine": false }, "keys": "ctrl+shift+c" }, { "command": "selectAll", "keys": "ctrl+shift+a" }, { "command": "scrollDown", "keys": "ctrl+shift+down" }, { "command": { "action": "adjustFontSize", "delta": 1 }, "keys": "ctrl+plus" }, ``` et al, would instead be replaced by: ```json { "command": { "action": "copy", "singleLine": false }, "keys": "alt+shift+c" }, { "command": "selectAll", "keys": "alt+shift+a" }, { "command": "scrollDown", "keys": "alt+shift+down" }, { "command": { "action": "adjustFontSize", "delta": 1 }, "keys": "alt+plus" }, ``` ? <hr> **OR** Are you looking for a setting to change the way the Terminal encodes <kbd>ctrl</kbd>/<kbd>alt</kbd>, so that pressing <kbd>ctrl+key</kbd> would instead send `alt+key` to the connected commandline application? (e.g. you'd need to press <kbd>alt+z</kbd> to send a `^Z` to the client application)? <hr> The first I don't think we'll be adding any time soon - you're more than welcome to change the bindings yourself in the settings. The second I suppose is a viable feature request...
Author
Owner

@CatCatCatDog commented on GitHub (Sep 12, 2022):

Yeah, I think so, You don't understand.
How about this?

{"command":{"action":"sendInput","input":"\u0003"},"keys":"alt+c"},
{"command":"copy","keys":"ctrl+c"},

If you use this json, You can string copy with ctrl + c.
If you want to interrupt, You can use interrupt with alt + c.
This means, ctrl and alt keys switched.
But, Actually, I want to only switch ctrl and alt keys.

@CatCatCatDog commented on GitHub (Sep 12, 2022): Yeah, I think so, You don't understand. How about this? {"command":{"action":"sendInput","input":"\u0003"},"keys":"alt+c"}, {"command":"copy","keys":"ctrl+c"}, If you use this json, You can string copy with ctrl + c. If you want to interrupt, You can use interrupt with alt + c. This means, ctrl and alt keys switched. But, Actually, I want to only switch ctrl and alt keys.
Author
Owner

@carlos-zamora commented on GitHub (Oct 19, 2022):

Hi @CatCatCatDog. Maybe PowerToys may be of interest to you! It has a keyboard manager that lets you do exactly this (and much more). Here's a link to the relevant docs: https://learn.microsoft.com/en-us/windows/powertoys/keyboard-manager

@carlos-zamora commented on GitHub (Oct 19, 2022): Hi @CatCatCatDog. Maybe PowerToys may be of interest to you! It has a keyboard manager that lets you do exactly this (and much more). Here's a link to the relevant docs: https://learn.microsoft.com/en-us/windows/powertoys/keyboard-manager
Author
Owner

@rds commented on GitHub (Dec 8, 2022):

Are you looking for a setting to change the way the Terminal encodes ctrl/alt, so that pressing ctrl+key would instead send alt+key to the connected commandline application? (e.g. you'd need to press alt+z to send a ^Z to the client application)?

Being able to remap modifier keys is exactly the feature I would love to see. For example, I would like to swap ctrl and alt in Windows (via PowerToys, etc) but swap them back in Terminal for Linux use.

@rds commented on GitHub (Dec 8, 2022): > Are you looking for a setting to change the way the Terminal encodes ctrl/alt, so that pressing ctrl+key would instead send `alt+key` to the connected commandline application? (e.g. you'd need to press alt+z to send a `^Z` to the client application)? Being able to remap modifier keys is exactly the feature I would love to see. For example, I would like to swap `ctrl` and `alt` in Windows (via PowerToys, etc) but _swap them back_ in Terminal for Linux use.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18423