-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Close tab shortcut (Ctrl+F4) doesn't work if window focus is not on title bar #8585
Comments
So, this is a weird thing. That binding's not supposed to work unless you go into your settings and explicitly bind it yourself. That it does work anywhere without it being bound explicitly is the bug I'd rather fix. 😄 |
I wonder if XAML is providing the Ctrl+F4 keybinding themselves... Oh they are! That's certainly interesting. I'd say in general, if you want Ctrl+F4 to work to close a tab, I'd add a keybinding for it, since it's not bound by default. That would look something like { "keys": "ctrl+f4", "action": "closePane" } (we use |
@zadjii-msft Thanks for the tip! Unfortunately it doesn't seem to work for me. :/ Like @ThomsonTan said, if I click on the tab head first, ctrl+f4 works. Interestingly, ctrl+shift+w works like I wish ctrl+f4 did. ctrl+tab also switches the tabs as expected (without having to click on the tab heads first. :S) |
I don't know what I was thinking closing this. Maybe because I was triaging at 5am? Yea, we should unbind that from the TabView, so that Ctrl+F4 works in both the terminal content and in the tab view. Now, how we remove that keybinding from the TabView is another question entirely. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
As a work-around, is there a key bind to "focus tab bar"? I looked it up in the docs but couldn't find something like this. This way I could do:
... without using the mouse |
Not currently, and outside the context of this bug, I'm not sure there's really a use case for that. I think it'd just be easier to solve the underlying bug then add the workaround 😉 |
@zadjii-msft ok thx, I think I'm gonna stick with the default WSL2 terminal for now, but I will check again Windows Terminal when this issue is solved :) Have a good day |
@elouanKeryell-Even If I may point out... the default WSL console host also does not support Ctrl+F4. What specifically about this key binding is holding you back? Just to be clear: you can keybind ctrl+f4 to " What specific thing do you need to focus the tab bar for? |
HOLY GOSH. The whole thesis of this bug is premised on a typo. The keybinding should be { "keys": "ctrl+f4", "command": "closePane" },
That works perfectly fine in the terminal today. That's what I get for triaging at 5am. |
Using Version: 1.7.1033.0 Not sure whether it was intended or not but there is a tooltip over the the tab's [X] button that say closing is Ctrl + F4, but on a fresh install of the above, its not there. Was able to add the command in the JSON file and then it works perfectly. |
Can confirm the above, the tooltip says it on a fresh install but it's not functional without the focus. Adding the "closeTab" binding works. |
I confirm that this is still there. Should the tooltip not be displayed if the relative configuration does not exist? |
just fix the tool tip description for the "close Tab" [x] button to "CTRL+SHIFT+W" and this shouldnt be an issue any longer. |
@Gorschel As mentioned earlier in the thread, there's no way for us to override that text. It's being generated in code-behind in WInUI itself, and there's no way for us to replace that. In general, Terminal tries to make sure to add shift to our default keybindings, because all sorts of commandline applications will also try to bind the non-shift versions, and we try to not step on their toes. It's a point of pain that we've experienced many times in the past. You're always free to rebind keybindings as you see fit! |
Environment
Steps to reproduce
+
in the title bar to create a new tab in Windows Terminal.Expected behavior
The newly created tab is closed after Ctrl+F4.
Actual behavior
Nothing changed and the new tab still exists.
Seems Ctrl+F4 to close tab window only works if the tab/title bar has Window focus. For example, it works if I click tab title before pressing Ctrl+F4.
The text was updated successfully, but these errors were encountered: