zed icon indicating copy to clipboard operation
zed copied to clipboard

Spacebar Not Working in Zed Editor with English Keyboard Layout

Open RosaErick opened this issue 1 year ago • 11 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When the keyboard layout is set to English, the spacebar does not function within the Zed editor. This issue is isolated to the Zed editor, as the spacebar works normally in all other applications. Steps to reproduce:

Set your keyboard layout to English. Open the Zed editor. Try to use the spacebar inside the editor. The spacebar will not produce a space character.

Environment

Zed: v0.149.3 (Zed) OS: Linux X11 fedora 40 Memory: 23.4 GiB Architecture: x86_64 GPU: NVIDIA GeForce RTX 2060 || NVIDIA || 550.107.02

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

RosaErick avatar Aug 22 '24 12:08 RosaErick

Hi, I also had this issue.

I found that it happened once I installed zoom (and along with it ibus, the english spacebar stopped working (though when I switched language it worked in Hebrew).

Once I uninstalled Ibus and restarted the computer, the issue went away... Just means that there might be trouble using both zoom and zed together.

Hope this helps you folks debug the issue, keep up the good work!

gthecht avatar Sep 03 '24 15:09 gthecht

well ibus is needed for GNOME, i dont even have zoom installed, never had, so im not uninstalling ibus, this is a bug from zed key binding, waiting for them to fix it

RosaErick avatar Sep 07 '24 04:09 RosaErick

Also having the same issue. Changing from English (US) to Estonian keyboard the space works. Also English (UK) does not have this problem

Laurits7 avatar Jan 01 '25 21:01 Laurits7

I also have the same issue, but I seem to have found a workaround. The space works with any primary keyboard layout and does not with any other. It does not matter, which layout (English, etc.) is primary. If there is only one layout, the spacebar works.

In my case, I have the Czech QWERTY layout as primary and the spacebar works, if I switch to secondary English US, the spacebar does not work. If I make the US layout primary, now the spacebar works with it but does not with Czech.

Zed: v0.167.2 OS: Linux X11, Fedora 40, Cinnamon Architecture: x86_64 Memory: 15.5 GiB Graphics: Intel UHD Graphics 620

MStarha avatar Jan 07 '25 18:01 MStarha

I also have the same issue, but I seem to have found a workaround. The space works with any primary keyboard layout and does not with any other. It does not matter, which layout (English, etc.) is primary. If there is only one layout, the spacebar works.

In my case, I have the Czech QWERTY layout as primary and the spacebar works, if I switch to secondary English US, the spacebar does not work. If I make the US layout primary, now the spacebar works with it but does not with Czech.

Zed: v0.167.2 OS: Linux X11, Fedora 40, Cinnamon Architecture: x86_64 Memory: 15.5 GiB Graphics: Intel UHD Graphics 620

Indeed, this seems to be the case also for me

Laurits7 avatar Jan 09 '25 13:01 Laurits7

Same here. But it seems like this issue is only exclusive to Xorg, on Wayland everything's fine for me.

poffomoe avatar Mar 21 '25 12:03 poffomoe

I also have the same issue, but I seem to have found a workaround. The space works with any primary keyboard layout and does not with any other. It does not matter, which layout (English, etc.) is primary. If there is only one layout, the spacebar works.

In my case, I have the Czech QWERTY layout as primary and the spacebar works, if I switch to secondary English US, the spacebar does not work. If I make the US layout primary, now the spacebar works with it but does not with Czech.

Zed: v0.167.2 OS: Linux X11, Fedora 40, Cinnamon Architecture: x86_64 Memory: 15.5 GiB Graphics: Intel UHD Graphics 620

Having exact same issue

giltine avatar Mar 22 '25 21:03 giltine

I also have the same issue, but I seem to have found a workaround. The space works with any primary keyboard layout and does not with any other. It does not matter, which layout (English, etc.) is primary. If there is only one layout, the spacebar works.

In my case, I have the Czech QWERTY layout as primary and the spacebar works, if I switch to secondary English US, the spacebar does not work. If I make the US layout primary, now the spacebar works with it but does not with Czech.

Zed: v0.167.2 OS: Linux X11, Fedora 40, Cinnamon Architecture: x86_64 Memory: 15.5 GiB Graphics: Intel UHD Graphics 620

Same, but with Russian layout. Mint 22 (Wilma) Cinnamon, X11.

NotYourFox avatar Apr 23 '25 21:04 NotYourFox

I also have the same issue, but I seem to have found a workaround. The space works with any primary keyboard layout and does not with any other. It does not matter, which layout (English, etc.) is primary. If there is only one layout, the spacebar works. In my case, I have the Czech QWERTY layout as primary and the spacebar works, if I switch to secondary English US, the spacebar does not work. If I make the US layout primary, now the spacebar works with it but does not with Czech. Zed: v0.167.2 OS: Linux X11, Fedora 40, Cinnamon Architecture: x86_64 Memory: 15.5 GiB Graphics: Intel UHD Graphics 620

Same, but with Russian layout. Mint 22 (Wilma) Cinnamon, X11.

this bug as fixed for me on 0.183.10

fabianosl1 avatar Apr 24 '25 10:04 fabianosl1

Not for me. The spacebar still does not work with secondary keyboard layout even on v0.183.10.

MStarha avatar Apr 24 '25 18:04 MStarha

I wanted to try Zed but ran into this same issue unfortunately.

I tried editing the ~/.config/zed/keymap.json file and adding the space using this line in the bindings section under context "Editor": "space": ["workspace::SendKeystrokes", " "]

But that made it worse; where initially the space under the Dutch (standard) layout worked, it no longer did after making the change. My keyboard layout is English (US).

Running Zed 0.185.13 on: Distributor ID: Linuxmint Description: Linux Mint 22 Release: 22 Codename: wilma

netson avatar May 08 '25 23:05 netson

Linux Mint 22.1 Kernel: 6.8.0-62-generic DE: Cinnamon 6.4.8 Zed: 0.191.7 a3e535d72007d0c0e55c1e8a1b62a64e31927d2b

British keyboard layout on a Dell laptop. No space for me either. I enjoy a challenge but this issue makes development quite difficult. It did give me a good laugh, though.

Melluish avatar Jun 23 '25 00:06 Melluish

Linux Mint 22.1 Kernel: 6.8.0-62-generic DE: Cinnamon 6.4.8 Zed: 0.191.9

British keyboard

LafuenteColoradoJose avatar Jun 25 '25 05:06 LafuenteColoradoJose

plus one here, does not work with russian layout

Linux Mint 22.1 DE: Cinnamon 6.4.8

same story as https://github.com/zed-industries/zed/issues/20465#issuecomment-2676897646

Set27 avatar Jun 25 '25 13:06 Set27

Same issue

Linux Mint 22.1 Cinnamon 6.4.8 Zed 0.192.5

artemius-x avatar Jun 26 '25 08:06 artemius-x

Looks like https://github.com/zed-industries/zed/pull/31174 might fix this.

Edit: I was able to reproduce this issue on latest stable Linux Mint Cinnamon with Dutch layout. Issue is likely how are handing mask on key press event on this line:

https://github.com/zed-industries/zed/blob/96ff6d86a3666b4efcd5ae16b008e286405e9b98/crates/gpui/src/platform/linux/x11/client.rs#L1033

Simply masking to bits 0-7 fixes the issue i.e. (event.state.bits() & 0xff) as ModMask but I think there should be better solution than that, which above mentioned PR might be taking look at. Ref: https://www.x.org/releases/X11R7.6/doc/libX11/specs/XKB/xkblib.html#keyboard_state_description

smitbarmase avatar Jul 10 '25 14:07 smitbarmase

#31174 (closed unmerged) was superceded by https://github.com/zed-industries/zed/pull/34053 and https://github.com/zed-industries/zed/pull/34396 but I don't have the context to know whether it'll fixes this.

Can someone validate whether this is still an issue in main? (Or check v0.196.0 when it becomes available in Zed Preview on Wednesday 2025-07-16).

notpeter avatar Jul 14 '25 15:07 notpeter