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

Keybind disable mode #9301

Open
Sidneys1 opened this issue Feb 26, 2021 · 5 comments
Open

Keybind disable mode #9301

Sidneys1 opened this issue Feb 26, 2021 · 5 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@Sidneys1
Copy link

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.

@Sidneys1 Sidneys1 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Feb 26, 2021
@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 Feb 26, 2021
@zadjii-msft
Copy link
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

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 1, 2021
@Sidneys1
Copy link
Author

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 1, 2021
@ptr727
Copy link

ptr727 commented Mar 22, 2021

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

@zadjii-msft
Copy link
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

@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Mar 23, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 23, 2021
@zadjii-msft zadjii-msft added this to the Icebox ❄ milestone Mar 23, 2021
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Apr 13, 2021
@zadjii-msft
Copy link
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
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants