microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.51k stars 8.31k forks source link

Make the Windows menu ("alt spacebar") accessible without a mouse in wsl #5833

Open henrik-jensen opened 4 years ago

henrik-jensen commented 4 years ago

Description of the new feature/enhancement

Make alt+space or an alternative key combination access the Application context menu in a wsl console. Edit: This is a feature request for "...the original Windows console host, ...", (which I assume is where the shortcuts are implemented), not the new terminal. Edit2: In the windows console, ctrl+m activates the select/copy feature and ctrl+f the find menu (danish and english versions). These are only accessible through the "alt+space"-menu (rodent menu) in a WSL session . Adding an alternative to these in Windows Console for WSL would be a super deluxe bonus value productivity enhancement.

Pressing alt+spacebar opens this menu on common windows apps: AppContextMenu

In the good old Windows Console/Terminal, as well as most windows app you have access to the (I think it's called?) application context menu, through alt+space without using the mouse. In WSL this does not work. We've got the ctrl+shift+c/v shortcut workarounds to paste/copy. A similar shortcut workaround for alt+space would be much appreciated for those with rodent allergy.

Proposed technical implementation details (optional)

<!-- 
A clear and concise description of what you want to happen.
-->

I have no idea how to implement it but I really would like a relief for my carpal tunnel syndrome :-)

DHowett-MSFT commented 4 years ago

You know, I was ready to say that this wouldn't be possible because we wanted to send alt+space to the connected application. We do, we absolutely do, but perhaps alt+shift+space (which doesn't have a VT encoding(!)) could pop up the system menu.

DHowett-MSFT commented 4 years ago

fwiw: alt+space in Windows Terminal (instead of the traditional console host) actually does open the system menu. It doesn't let you use any of the actions the console does, but hey, precedent.

henrik-jensen commented 4 years ago

You know, I was ready to say that this wouldn't be possible because we wanted to send alt+space to the connected application. We do, we absolutely do, but perhaps alt+shift+space (which doesn't have a VT encoding(!)) could pop up the system menu.

alt+shift+space would be just fine for the old console host. ctrl+shift+c/v works in both Windows Terminal and Old Console Host, running wsl, but ctrl+shift+c seams kind of useless without ctrl+m for coping. (You have to use the mouse anyway so you just click right mouse button after select). How about ctrl+shift+m for select mode. Would that be possible? (for old and new) And ctrl+shift+a (select all), ctrl+shift+f (find) to mirror the Console Host shortcuts in a cmd-session like the copy/paste does? All these of course preferably optional as the ctrl+shift+c/v's are. Edit: After reconsidering - all these shortcuts are probably used in emacs, vi and lots of other console aps, (just think of the drama :-) ), so ... could/should the alt+space menu with an edit submenu be implemented in the the new Windows Terminal? (I mean alt+space is already taken so it won't result in the sudden end of the editor war and the start of an unholy alliance of emacs and vim users against Windows Terminal :-) )

Neurrone commented 4 years ago

I'm not sure if this is related, but I'm having trouble figuring out how to view the tabs open or open dialogs like the settings and help dialog. They don't appear as options when pressing alt+space.

Neurrone commented 4 years ago

Oh, I just realized that the whole row of controls at the top to switch between tabs can only gain keyboard focus when clicking with a mouse :(

binki commented 4 years ago

You know, I was ready to say that this wouldn't be possible because we wanted to send alt+space to the connected application. We do, we absolutely do, but perhaps alt+shift+space (which doesn't have a VT encoding(!)) could pop up the system menu.

Thanks, didn’t know about this shortcut. It actually works in normal applications already. Somehow, MSYS2 in its latest version turns off using alt+space to open the system menu when run from within CMD but it doesn’t trap alt+shift+space. I will be using this combination everywhere from now on!

dobsa commented 2 years ago

I consider Alt+Space standard combination since it works across application types in Windows for decades (For example also in GUI applications). There absolutely must be a possibility to configure Alt+Space to be used for Window management. Again most commonly used SSH GUI client out there -- PuTTY -- has this option for decades. Alt+Shift+Space would be a lame workaround. Configuration option for this is needed. What is particularly annoying is that Alt+Space works in cmd.exe. But as soon as I connect to a Linux server using Microsoft's port of OpenSSH it stops working and it cannot be configured. If it can, please tell me how.

zadjii-msft commented 2 years ago

FWIW this is totally configurable in the Terminal, and works even in WSL. It's just conhost (the vintage console) where this is an issue. The keybindings in cohost have always been a source of constant pain, just the way they're plumbed through makes thinks like this REALLY HARD to solve. We also definitely don't have any plans to fix this for conhost any time soon - we're not really specifically investing in that UX any longer.

I'm gonna leave this open if someone does want to add alt+shift+space to conhost. But if you want real configurability, I'd just recommend the Terminal.