Terminal: Default bindings are unusual for people who expect them to be usual

Created on 22 Jun 2019  路  13Comments  路  Source: microsoft/terminal

Environment

Microsoft Windows [Version 10.0.18362.175]

Vim/Neovim

Steps to reproduce

Have a program running in the terminal that listens to bindings that conflict with Windows Terminal.

I noticed this in Vim when switching split editing windows of Vim. The binding is <Ctrl>+<w> and then any of <h> <j> <k> <l>.

The terminal starts crashing at this point.

Expected behavior

Not sure, for my particular issue I managed to fix this by changing the closeTab command from ctrl+w to something else.

Maybe this is Intended?

Actual behavior

The terminal crashes.

Area-Settings Issue-Question Needs-Tag-Fix Product-Terminal Resolution-Fix-Committed

Most helpful comment

@DHowett-MSFT ^W is the default keybinding for delete-word in readline, which means that Unix users stumble over it all the time (at least I do). I think that using the gnome-terminal defaults might be interesting (ctrl+shift+w for close, ctrl+shift+c for copy, ctrl+shift+v for paste, etc).

All 13 comments

The crash is #1339 #1380 (1380 is the new reopened version of the bug). The key bindings are not yet tracked but I agree that ctrl+w is an annoying conflict.

@DHowett-MSFT ^W is the default keybinding for delete-word in readline, which means that Unix users stumble over it all the time (at least I do). I think that using the gnome-terminal defaults might be interesting (ctrl+shift+w for close, ctrl+shift+c for copy, ctrl+shift+v for paste, etc).

stumble over it all the time

That鈥檚 an understatement. I chose to rebind it and we should reconsider the defaults, or prompt the user which default bindings they prefer.

I am agree with this issue, the default shorcuts could be better. For example, Control + W is used in nano for searching terms. With the actual default settings the tab (or even the terminal) is closed suddenly. A new user could think that is a bug. The use of gnome-terminal default shorcut are a good choice (always allowing to be able to customize).

Thoughts: maybe on first launch we ask if you're more used to X or Y style bindings? That could be a 2.0 feature.

Getting a prompt on the first time you open an app is kind of annoying -- that's the beginning of a setup wizard.

An experience that might be neat is the first time you press ctrl+w it prompts you to ask if that should close the window?

But the simplest solution is to not set conflicting defaults, and let users add them. profiles.json supports comments, so the default profiles.json could contain:

// Uncomment to enable ctrl+w for closeTab
/* {
    "command" : "closeTab",
    "keys" : 
    [
        "ctrl+w"
    ]
}, */

+1 to all of these. In a Linux-y shell, I reflexively hit Ctrl+W all the time. Apparently I hadn't disable that shortcut on this PC yet and it killed my terminal, ssh session, and remote text editor without so much as a prompt. Ideally Ctrl+W shouldn't be close tab, but it should at _least_ warn about closing a tab with stuff running in it.

An experience that might be neat is the first time you press ctrl+w it prompts you to ask if that should close the window?

I'm not at all a fan of the prompt idea regardless of when the prompt pops up. The terminal should just use sane defaults. If I don't like the defaults, I can change them manually. That's why there's a config file.

As someone who just found out about this after accidentally closing my terminal 4 times in a row, I can testify that this is a very weird key combination to be having 'standard', especially for any who are using WSL and various linux tools that make sure of the normal key combination ctrl+w. Not trying to make this a +1, though it is a +1!

I understand they're trying to make this friendly for any who are coming from a web browser, but you need to make these key combinations work in mind with regular power users who will use nearly all of the standard regular key combinations, and if you're going to do destructive actions such as closing the tab, it definitely should require a third key in the combination.

Just my two cents, as I'm able to edit the bindings directly in the text settings file, but this would likely be off-putting for nearly anyone else coming to this terminal manager for the first time.

Hey all, we're looking at changing some of the defaults here to require shift in addition to control to line up with other terminal emulators. PR #2014 makes that change. Is that something you're all comfortable with?

LGTM! I'm already overriding the defaults. Please also change CloseTab to require shift.

https://github.com/microsoft/terminal/blob/08565bd5a3bea6331b4abbd31f1224431102a2fd/src/cascadia/TerminalApp/CascadiaSettings.cpp#L288-L290

please also change

From the pull request,

"#2012 Changes "Close Window" by removing it by default, and adding ClosePane on Ctrl+Shift+W"

:smile:

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

Handy links:

Was this page helpful?
0 / 5 - 0 ratings