Skip to content

Keybind disable mode #9301

Open
Open

Description

@Sidneys1

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.

Activity

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Feb 26, 2021
  2. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Feb 26, 2021
  3. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Feb 26, 2021
  4. zadjii-msft commented on Mar 1, 2021

    @zadjii-msft
    Member

    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

  5. Sidneys1 commented on Mar 1, 2021

    @Sidneys1
    Author

    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.

  6. ghost added
    Needs-AttentionThe core contributors need to come back around and look at this ASAP.
    on Mar 1, 2021
  7. ghost removed
    Needs-Author-FeedbackThe original author of the issue/PR needs to come back and respond to something
    on Mar 1, 2021
  8. ptr727 commented on Mar 22, 2021

    @ptr727

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

  9. zadjii-msft commented on Mar 23, 2021

    @zadjii-msft
    Member

    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

  10. added
    Area-SettingsIssues related to settings and customizability, for console or terminal
    and removed
    Needs-AttentionThe core contributors need to come back around and look at this ASAP.
    on Mar 23, 2021
  11. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Mar 23, 2021
  12. removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Apr 13, 2021
  13. zadjii-msft commented on Apr 15, 2024

    @zadjii-msft
    Member

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsIssues related to settings and customizability, for console or terminalIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions