WSL2/WSLg: Intellij keyboard shortcuts not working as expected
Some keyboard shortcuts do not work in Intellij when running in WSL
One of the quirks of running UI apps in WSL with WSLg is that some keyboard shortcuts do not work or cause unexpected behaviour.
Intellij users are accustomed to use Ctrl + Alt + Left/Right to jump between last visited code locations. If you do this in Intellij (or any other Jetbrains IDE) running in WSL with WSLg the IDE looses the focus and stops reacting to keyboard input.1
Currently, the only workaround is to reassign the keyboard shortcut in your Jetbrains IDE.
Although this looks like a bug this is actually by design. WSLg uses the Remote Desktop Connection client (mstsc) on the host in silent mode to launch UI applications. The keyboard shortcut Ctrl + Alt + Left/Right are assigned by the Remote Desktop Connection client (mstsc) to switch between sessions or ‘tab’ out of the Remote Desktop controls to a control in the host app.2
Fortunately, one of the next Windows 11 updates will add support for the new Remote Desktop client (msrdc) to WSL which fixes this issue. If you want to be rid of this quirk immediately, you can install the WSL preview from the Windows App Store. Installing the preview over your existing WSL installation will not alter your existing Linux installation.