Fix non-ASCII keyboard input (ä ö ü ß, AltGr €) in Blit graphical apps and terminals - #298
Open
haraldschilly wants to merge 3 commits into
Open
Fix non-ASCII keyboard input (ä ö ü ß, AltGr €) in Blit graphical apps and terminals#298haraldschilly wants to merge 3 commits into
haraldschilly wants to merge 3 commits into
Conversation
German-layout users cannot type ä ö ü ß or AltGr+€ into Blit. Two independent causes, recorded here with the code references behind each. Graphical windows: Blit's compositor compiles in a single US-QWERTY XKB keymap with no way to change it, so the browser resolves the user's layout itself and sends printable characters as text rather than keycodes. The compositor synthesises evdev keys only for the ASCII subset US-QWERTY can express and routes everything else through zwp_text_input_v3.commit_string alone. Clients that never enable an input method drop those characters, which upstream's own comments state outright, and Xwayland cannot bind the protocol at all. Terminals: a different path entirely, since Blit writes UTF-8 straight to the PTY. Projects ran with no LANG, so the shell sat in POSIX where readline's convert-meta mangles multi-byte input. Also rules out version skew, iframe embedding, and a per-account keyboard-layout setting, and records which applications each downstream fix does and does not reach. Upstream gap filed as indent-com/blit#317.
Projects ran with no LANG at all, so every process inherited POSIX/C. Confirmed on cocalc.ai: `locale` reports POSIX across the board with LANG and LC_ALL empty. In the C locale readline enables convert-meta, which mangles every multi-byte character, so a German-layout user cannot type ä ö ü ß into a terminal. Anything else that trusts LC_CTYPE for its input encoding — Tk, Emacs, and Blit's PTYs among them — fails the same way. This is the "umlauts don't work in a container" problem: the Ubuntu images name no locale and nothing downstream supplied one. Default LANG to C.UTF-8 in the project container environment. It is always present and needs no locale generation, and an image that names its own locale keeps it. The workspace runtime was never affected — its inherited-env allowlist already passes LANG, LC_ALL and LC_CTYPE through from the host.
Blit's compositor advertises a single hard-coded US-QWERTY keymap and delivers every character that keymap cannot express -- umlauts, AltGr characters -- through zwp_text_input_v3 alone. X11 clients cannot bind that protocol, so any app that ends up on Xwayland silently drops non-ASCII input. Three apps in the catalog were on the wrong side of that line. Chromium was launched with --ozone-platform=wayland but not --enable-wayland-ime, and Chromium binds zwp_text_input_v3 only when its Wayland IME support is enabled, so it never saw a commit_string. Emacs installed emacs-gtk, which is the X11 build. emacs-pgtk is the same editor built against GTK for Wayland. Krita and TeXstudio relied on the QT_QPA_PLATFORM="wayland;xcb" that Blit exports, but Qt falls back to xcb without complaint when its Wayland platform plugin is missing and nothing installed one -- so both ran as X11 clients despite the hint. They now pull qt6-wayland and qtwayland5; both generations are listed because the packaged Qt version moves between Ubuntu releases. Projects that already installed one of these apps keep the old packages, since the launcher skips installation once the executable exists. IDLE, XClock, and GIMP 2.x on Ubuntu 24.04 remain X11-only with no Wayland build to switch to; those depend on indent-com/blit#317.
Contributor
|
Found 15 test failures on Blacksmith runners: Failures
...and 5 more test failures. View all on Blacksmith
|
haraldschilly
marked this pull request as ready for review
August 26, 2026 15:33
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 051a58f5c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light.png)
German-layout users cannot type
ä ö ü ßor AltGr+€into Blit. Investigationfound two independent causes, only one of which is ours. Full notes, with
code references for every claim, are in
src/.agents/blit-keyboard-layout-20260826.md.1. Terminals: projects had no locale (fixed here)
Projects ran with no
LANGat all. Confirmed on cocalc.ai:In the C locale readline enables
convert-meta, which mangles every multi-bytecharacter — the classic "umlauts don't work in a container" problem. Anything
that trusts
LC_CTYPEfor its input encoding fails the same way, Blit's PTYsincluded.
getEnvironment()now defaultsLANGtoC.UTF-8, which is always present andneeds no locale generation. An image naming its own locale keeps it. The
workspace runtime was never affected — its inherited-env allowlist already
passes the locale variables through from the host, which is also why local dev
never reproduced this.
2. Graphical windows: apps silently running on X11 (partly fixed here)
Blit's compositor compiles in a single US-QWERTY XKB keymap and has no way to
change it. The browser compensates by resolving the user's layout itself and
sending printable characters as text rather than keycodes — that part works, and
e.keyis"ä"as it should be. But the compositor synthesises evdev keys onlyfor the ASCII subset US-QWERTY can express, and routes everything else through
zwp_text_input_v3.commit_stringalone. A client that never enables an inputmethod drops those characters, and X11 clients cannot bind the protocol at all.
So any app that ends up on Xwayland loses all non-ASCII input. Three apps in our
catalog were on the wrong side of that line:
silently. Blit exports
QT_QPA_PLATFORM="wayland;xcb", and Qt falls back toxcb without complaint when its Wayland platform plugin is missing. Nothing
installed one, so both ran as X11 clients despite the hint. They now pull
qt6-waylandandqtwayland5(both generations, since the packaged Qtversion moves between Ubuntu releases).
--ozone-platform=waylandbut not--enable-wayland-ime. Chromium bindszwp_text_input_v3only when itsWayland IME support is on, so it never received a
commit_string.emacs-gtk, the X11 build.emacs-pgtkis the sameeditor built against GTK for Wayland.
What this does not fix
IDLE, XClock, and GIMP 2.x on Ubuntu 24.04 have no Wayland build to switch
to — Tk has no Wayland backend at all. They stay broken for non-ASCII input
until Blit grows a fallback for clients without text-input.
Reported upstream as indent-com/blit#317, with the
mechanism and a suggested direction (bind a spare keycode to the needed keysym,
push the updated keymap via
wl_keyboard.keymap, press, restore — the approachxdotool/wtypeuse; Blit already owns the keymap bytes). We are not sending aPR for it. No prior upstream issue existed — a search for keymap, xkb, layout,
text-input, umlaut, AltGr and plain "keyboard" returned nothing.
Also worth knowing: the launcher skips installation once an app's executable
exists, so a project that already installed Krita or TeXstudio keeps the old
package set and is not repaired by this.
Ruled out
Version skew (we pin Blit 0.55.1, effectively upstream HEAD), iframe embedding,
and a per-account keyboard-layout setting — there is nothing for such a setting
to attach to, since the keymap is compiled into the Blit binary and the browser
already applies the user's real layout.
Validation
Unit tests for both changes;
pnpm tscandlint:frontendclean.Verified on the local Launchpad dev stack (Multipass project host, podman
runtime):
The locale bug reproduces locally, matching cocalc.ai exactly — inside a
running project container,
LANGis empty andLC_CTYPE="POSIX".Every new package name resolves, on both Ubuntu releases, so the app
installer cannot break on a bad name (it runs
apt-get install -yunderset -euo pipefail, where one missing package fails the whole install):emacs-pgtkqt6-waylandqtwayland5Worth noting Krita on 24.04 is 5.2.x (Qt5) while 26.04 has 6.x — which is
exactly why both Qt generations are listed rather than just one.
Still unverified end-to-end: that
LANGactually arrives asC.UTF-8in acontainer.
getEnvironment()runs in the project-host inside the VM, so provingit live needs a project-host bundle rebuild, version pin, and reconcile. The
pre-fix state is confirmed reproduced, and the change is unit-tested.
Also unverified: the umlaut round-trip itself, which needs a browser on a German
layout typing into the Blit iframe.