Keybind disable mode #12747

Open
opened 2026-01-31 03:23:47 +00:00 by claunia · 5 comments
Owner

Originally created by @Sidneys1 on GitHub (Feb 26, 2021).

Description of the new feature/enhancement

There should be a way to allow "passthrough" of keybindings to the terminal session - for example, the keybinding Ctrl+Shift+↓ is used in Terminal to resize a pane, but it's also used by the Linux terminal multiplexer BYOBU to resize panes.

I envision something like a command in the palette to disable Terminal keybindings and allow then to pass through to the terminal itself. This command would automatically disable "focus mode" (since there'd be no way to exit focus mode again) and would be a toggle.

I searched around in existing open/closed tickets as well as the documentation to see if something like this already exists, and as far as I can tell it doesn't. #5790 is somewhat related, in that it could be a "workaround" for this feature.

Proposed technical implementation details (optional)

I imagine it'd be a fairly simple matter to have an early exit in the keybind handling code to check if this mode is enable, and if so act as if there are no keybindings.

Originally created by @Sidneys1 on GitHub (Feb 26, 2021). # Description of the new feature/enhancement There should be a way to allow "passthrough" of keybindings to the terminal session - for example, the keybinding <kbd>Ctrl+Shift+&darr;</kbd> is used in Terminal to resize a pane, but it's also used by the Linux terminal multiplexer BYOBU to resize panes. I envision something like a command in the palette to disable Terminal keybindings and allow then to pass through to the terminal itself. This command would automatically disable "focus mode" (since there'd be no way to exit focus mode again) and would be a toggle. I searched around in existing open/closed tickets as well as the documentation to see if something like this already exists, and as far as I can tell it doesn't. #5790 is somewhat related, in that it could be a "workaround" for this feature. # Proposed technical implementation details (optional) I imagine it'd be a fairly simple matter to have an early exit in the keybind handling code to check if this mode is enable, and if so act as if there are no keybindings.
claunia added the Issue-FeatureArea-SettingsProduct-Terminal labels 2026-01-31 03:23:47 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Mar 1, 2021):

You could try just disabling the keybindings that you don't want the terminal to use. I'm imagining that if you're using byobu, then you probably aren't using the panes in the Terminal. You could just unbind those specific keys:

        { "command": "unbound", "keys": "ctrl+shift+down" },
        { "command": "unbound", "keys": "ctrl+shift+up" },

wait hold up

for example, the keybinding Ctrl+Shift+↓ is used in Terminal to resize a pane

Resizing panes should be on Ctrl+Shift+{arrow}:

        { "command": { "action": "resizePane", "direction": "down" }, "keys": "alt+shift+down" },
        { "command": { "action": "resizePane", "direction": "left" }, "keys": "alt+shift+left" },
        { "command": { "action": "resizePane", "direction": "right" }, "keys": "alt+shift+right" },
        { "command": { "action": "resizePane", "direction": "up" }, "keys": "alt+shift+up" },

Disabling all keybindings seems like a pretty big hammer for this scenario

@zadjii-msft commented on GitHub (Mar 1, 2021): You could try just disabling the keybindings that you _don't_ want the terminal to use. I'm imagining that if you're using `byobu`, then you probably aren't using the panes in the Terminal. You could just unbind those specific keys: ```json { "command": "unbound", "keys": "ctrl+shift+down" }, { "command": "unbound", "keys": "ctrl+shift+up" }, ``` wait hold up > for example, the keybinding <kbd>Ctrl+Shift+↓</kbd> is used in Terminal to resize a pane Resizing panes should be on <kbd>Ctrl+Shift+{arrow}</kbd>: ```json { "command": { "action": "resizePane", "direction": "down" }, "keys": "alt+shift+down" }, { "command": { "action": "resizePane", "direction": "left" }, "keys": "alt+shift+left" }, { "command": { "action": "resizePane", "direction": "right" }, "keys": "alt+shift+right" }, { "command": { "action": "resizePane", "direction": "up" }, "keys": "alt+shift+up" }, ``` Disabling all keybindings seems like a pretty big hammer for this scenario
Author
Owner

@Sidneys1 commented on GitHub (Mar 1, 2021):

Hmm, then perhaps the solution is more in the issue I linked which would allow profiles to override keybindings. I use byobu on some WSL and SSH connections, but definitely not on all of my profiles. I use Terminal panes in some profiles. And regardless of whether my keybindings is default doesn't change that for some people the terminal keybindings are going to intersect with some client application keybindings at some point. Perhaps my approach is heavy-handed, but that doesn't mean the problem isn't valid.

@Sidneys1 commented on GitHub (Mar 1, 2021): Hmm, then perhaps the solution is more in the issue I linked which would allow profiles to override keybindings. I use byobu on some WSL and SSH connections, but definitely not on all of my profiles. I use Terminal panes in some profiles. And regardless of whether my keybindings is default doesn't change that for some people the terminal keybindings are going to intersect with some client application keybindings at some point. Perhaps my approach is heavy-handed, but that doesn't mean the problem isn't valid.
Author
Owner

@ptr727 commented on GitHub (Mar 22, 2021):

Such a feature will also help with Midnight Commander.
Either per profile setting, or a toggle, toggle passthrough on/off.

@ptr727 commented on GitHub (Mar 22, 2021): Such a feature will also help with Midnight Commander. Either per profile setting, or a toggle, toggle passthrough on/off.
Author
Owner

@zadjii-msft commented on GitHub (Mar 23, 2021):

Crazy thought that's going to sound like half a thought:

I've toyed around in my head with having different keymaps in the past, and letting the user just set their keymap to one of a pre-defined set, then apply keybindings on top of that keymap. So what if there was just a keymap with no keys defined, and then an action for "setKeymap" or something, that would let you hot-swap between keymaps. But then you'd need two keybindings - one for setKeymap(keymap=empty), and another for setKeymap(keymap=default).

See also #2205

@zadjii-msft commented on GitHub (Mar 23, 2021): Crazy thought that's going to sound like half a thought: I've toyed around in my head with having different `keymap`s in the past, and letting the user just set their `keymap` to one of a pre-defined set, then apply keybindings on top of that `keymap`. So what if there was just a keymap with no keys defined, and then an action for "setKeymap" or something, that would let you hot-swap between keymaps. But then you'd need two keybindings - one for `setKeymap(keymap=empty)`, and another for `setKeymap(keymap=default)`. See also #2205
Author
Owner

@zadjii-msft commented on GitHub (Apr 15, 2024):

From #17055:

I use Vim in Windows Terminal and there's some keys conflicting. I know that I can unbind these keys so that I can use them in Vim, and I know that I can changes these keys binding to other if I still need these helpful actions provided by this amazing project.

However, if I don't want to disrupt the default key bindings (since I'm not able to manage so many keys and I'd believe the default key bindings are assigned more logically), then I hope there's a toggling key to allow me to disable any other key bindings defined default in Windows Terminal when I use Vim or other applications and then enable it again when I need these default bindings.

Sure, this may not be the best way. But this is the best alternative that I can imagine. So it'd be highly appreciated if there're better ways to achieve my will.

@zadjii-msft commented on GitHub (Apr 15, 2024): From #17055: > I use Vim in Windows Terminal and there's some keys conflicting. I know that I can unbind these keys so that I can use them in Vim, and I know that I can changes these keys binding to other if I still need these helpful actions provided by this amazing project. > > However, if I don't want to disrupt the default key bindings (since I'm not able to manage so many keys and I'd believe the default key bindings are assigned more logically), then I hope there's a toggling key to allow me to disable any other key bindings defined default in Windows Terminal when I use Vim or other applications and then enable it again when I need these default bindings. > > Sure, this may not be the best way. But this is the best alternative that I can imagine. So it'd be highly appreciated if there're better ways to achieve my will.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12747