LaTeX-Workshop
LaTeX-Workshop copied to clipboard
Cmd+M shortcut prefix conflicts with window minimise on macOS
Preliminary questions [Required]
Disable all the other extensions except for LaTeX Workshop, restart VS Code, and check that you still see this issue. [Required]
Yes
Make sure to visit the wiki FAQ before filling an issue.
Yes
If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.
You can compile a TeX document manually?: Not applicable
Describe the bug [Required]
LaTeX Workshop defines a number of math-focused keyboard shortcuts (latex-workshop.shortcut.math*
). On Windows / Linux, they use a Ctrl+M
prefix, and perhaps that's okay over there. The macOS equivalent is Cmd+M
, which is already occupied by a default enabled OS-level shortcut for minimising windows.
To Reproduce
Steps to reproduce the behavior:
- Install extension on macOS
- Try to minimise VS Code with a LaTeX file focused
Expected behavior
I expect common OS-level shortcuts (such as this one) to always be functional in all programs.
Desktop [Required]
Please write exact version numbers. Please don't write latest
instead of exact numbers.
- OS: macOS 12.6
- VS Code version: 1.73.1
- Extension version: 9.0.1
- TeX distribution version: MacTeX 2022.0321
Additional questions
Are you using VSCodium?
No
Are you using the Snap or Flatpack versions of VS Code?
No
Are you using LaTeX Workshop with VS Code Remote?
No
As an aside, thanks for your great work on LaTeX Workshop! It's very helpful. ๐
It is a little more complicated than it looks. On Windows/Linux, ctrl+m
is used by vscode for editor.action.toggleTabFocusMode
. Because, we use ctrl+m
as a prefix, it deactivates vscode's default shortcut. So, we introduced ctrl+l ctrl+m
, see https://github.com/James-Yu/LaTeX-Workshop/wiki/FAQ#latex-workshop-uses-ctrlm-for-fonts-keybindings.
Looking closely at vscode's default shortcuts, it uses ctrl+shift+m
for editor.action.toggleTabFocusMode
. I was tempted to use shift+cmd+m
on osx, but this is already bound to workbench.actions.view.problems
.
I see two approaches:
- Add a new setting to deactivate all the
cmd+M
shortcuts. - Replace
cmd+M
byctrl+shift+M
for our shortcuts and definedcmd+l ctrl+shift+M
for `editor.action.toggleTabFocusMode, which is only used for keyboard only navigation.
Either approach would be okay for me... though I don't actually use these particular shortcuts from the extension, so mainly I'm just thinking about how to get them out of the way of OS defaults. ๐
Perhaps for those who do want to use these shortcuts on macOS, approach 2 sounds a bit nicer, since that way they could still use these extension shortcuts while still retaining OS default minimise behaviour.
An interesting observation: vscode use option+shift+M
for editor.action.toggleTabFocusMode
on macos, which is ctrl+shift+m
on windows. What about we change all cmd+M
s to option+shift+M
s for consistency? option+M
is OS-wise reserved for ยต
though.
Replacing Cmd+M
with Option+Shift+M
sounds like an improvement to me, even if it does stomp on an accented character (ร
)... Though, I have never needed to type such a character, so perhaps I am not the best one to decide... ๐
It seems that on OSX, vscode use ctrl+shift+M
for editor.action.toggleTabFocusMode
and not option+shift+M
. At least, this is the default shortcut used by vscode on my mac with a French keyboard. This is also what is shown on https://code.visualstudio.com/docs/getstarted/keybindings (the displayed shortcuts depend the OS).
The modifier shift+option
is often used on OSX to enter special characters. I am more in favour of using ctrl+shift+M
.
Ctrl+Shift+M
does indeed seem to be unoccupied on macOS, so perhaps that's a good fit.
There must be something wrong with my mac. Will do a PR on this shortly (tm).