code-server: Changing the keyboard layout doesn't stick

Am using latest code-server v4.0.1, but this also happened in v3.12.0.

I am referring to changing the keyboard layout via the button in the bottom-right of the editor:

image

Changing it from Layout: US to something else doesn’t seem to have any effect… it remains as Layout: US and does so even after re-loading the window. Well, it’s inconsistent because I managed to change it to Hungarian (but then it didn’t change to anything else)… but even after changing to Hungarian, when the window was reloaded it was back to US.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 23 (14 by maintainers)

Most upvoted comments

I tried this out on Codespaces and had similar problems so it appears to be an issue upstream.

What I observed:

  • Switching layout worked (visual indicator updated and keyboard shortcuts worked)
  • Refreshing switched me back to the default US layout
  • Switching layout stopped working (visual indicator does not update and keyboard shortcuts use the wrong keys)
  • If I delete keyboard.layout from my settings then switch the layout it works again (until the next refresh).

https://github.com/microsoft/vscode/issues/135960

One workaround is to set Keyboard: Dispatch to keycode instead of using layouts.

From what I can remember I think this has never worked although I remember seeing some changes in VS Code to support it so maybe it is something wrong on our end.

(b) it doesn’t seem to have any effect regardless of what the indication says.

I also recognized that and well, I don’t have any problem with that as long it uses the default system layout (everything else would prop. confuse)

Note that, in your video clip, the layout stated at the bottom right (where you click) does change to “Spanish” when you first change it from “US”, even if it doesn’t seem to have any effect, but doesn’t change when you then change it to “Russian” (it stays reading “Spanish”). So it seems to be broken on a couple of levels… (a) the indication doesn’t (always) change; and (b) it doesn’t seem to have any effect regardless of what the indication says.

(a) the indication doesn’t (always) change; and (b) it doesn’t seem to have any effect regardless of what the indication says.

I didn’t even notice - excellent observation!

Haha thanks for checking! Let me test now.

Hmm…you’re right. Nothing. I wonder why that could be 🤔 I wonder if it’s related to the logic we added to change the display language? Eh probably unrelated.

Any ideas @code-asher?

Video

https://user-images.githubusercontent.com/3806031/148606851-7259aa8f-b8d0-470a-b262-c7286533b58e.mov

@jsjoeio well it’s easy for me to reproduce 😃 I see nothing at all in either the server (docker) logs or the browser logs when I change the layout setting… not even when it does actually seem to change in the button itself (e.g. to French). But when I close/open the browser again, it’s back to US.