Enable IME on Linux/Wayland#9602
Conversation
Closes warpdotdev#9383. `set_ime_allowed(true)` was only called inside a `#[cfg(windows)]` block, so on Linux/Wayland the winit backend never sent `zwp_text_input_v3.enable()` to the compositor and IME stayed inactive — non-Latin input (CJK, etc.) was effectively unusable. Add a parallel `#[cfg(target_os = "linux")]` call right after the Windows one. macOS continues to use the native NSTextInputClient route and does not need this.
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: @vorporeal. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR enables winit IME handling for Linux windows by calling set_ime_allowed(true) after successful window creation, matching the existing Windows setup path and allowing Wayland text-input activation for CJK/non-Latin input.
Concerns
- No blocking correctness or security concerns found in the changed hunk.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
vorporeal
left a comment
There was a problem hiding this comment.
Functional verification needs a Wayland session, which I can't run locally; CI on Linux runners should cover compilation. A maintainer with a Wayland setup could confirm IME behaviour with a CJK input method.
i don't want to merge a prospective fix without confirmation that this fixes the reported issue; can you comment on the linked bug and ask someone there, who has experienced/reported this, to validate that this actually fixes the problem?
|
Pinged the reporter on #9383 asking them to validate against this branch on their Hyprland + fcitx5 setup (comment link). Worth flagging that the original issue body already contains "Verified fix: fcitx5 activates on |
|
@anshul-garg27 Confirmed on Arch Linux + Hyprland (Wayland) with fcitx5. After checking out this branch, Ctrl+Space activates the input method and CJK input works correctly — preedit and commit both function as expected |
Closes warpdotdev#9383. ### Description `set_ime_allowed(true)` was only being called inside the `#[cfg(windows)]` block in `crates/warpui/src/windowing/winit/window.rs::create_window` (the block that ends around line 1421 on master). On Linux/Wayland, winit's text-input plugin only sends `zwp_text_input_v3.enable()` to the compositor after `set_ime_allowed(true)` is called — without that call IME stays inactive, so non-Latin input methods (CJK in particular) appear to do nothing in Warp. ### Fix Add a parallel `#[cfg(target_os = "linux")]` block right after the Windows one calling the same method on the created window. macOS continues to use the native NSTextInputClient route and does not need this winit hint. A repo-wide grep for `set_ime_allowed` confirms there is no other Linux-specific call site that was already covering this — the previous behaviour was "Windows-only" by oversight, not by design. ```rust #[cfg(target_os = "linux")] if let Ok(window) = created_window.as_ref() { // On Linux/Wayland, winit only sends `zwp_text_input_v3.enable()` when IME is allowed, // so without this call IME stays inactive and non-Latin input (CJK, etc.) is unusable. window.set_ime_allowed(true); } ``` ### Testing - `cargo fmt -p warpui -- --check` — passes. - Compile-only verification possible from my checkout (Metal toolchain unavailable for full `cargo nextest`, mirroring warpdotdev#9277). The change is a 7-line addition that mirrors the existing Windows block exactly. - Functional verification needs a Wayland session, which I can't run locally; CI on Linux runners should cover compilation. A maintainer with a Wayland setup could confirm IME behaviour with a CJK input method. ### Coordination with warpdotdev#9536 PR warpdotdev#9536 (open) modifies the same file but inside `maybe_adjust_window_vertically` (lines ~1433+ on master, adding 3 lines that early-return on maximize/fullscreen). My edit lands in `create_window` on lines 1422–1428, which warpdotdev#9536 does not touch — no merge conflict expected. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries `CHANGELOG-BUG-FIX`: IME (input method) now activates on Linux/Wayland, restoring CJK and other non-Latin input that had been silently broken since first launch. Co-authored-by: anshul-garg27 <13553550+anshul-garg27@users.noreply.github.com> (cherry picked from commit 543d54e)
…ndle Without this flag, `setMarkedText:` callbacks from the macOS input system are short-circuited inside the terminal view (`set_marked_text_on_terminal` returns early) and no IME preedit is ever drawn. That breaks text input for any user typing through an IME — CJK pinyin / wubi, Japanese kana / romaji, Korean hangul, dead-key Latin (French / German / Spanish / Vietnamese), macOS auto-correct candidates, emoji candidate windows, etc. Visible symptom: typing pinyin shows no Latin preedit characters in the input box; the only thing that ever appears is the final committed Chinese characters after picking a candidate. Effectively, CJK users can't type at all in OSS macOS builds. Stable / Preview macOS already get this flag via `RELEASE_FLAGS` because they build with `cfg!(feature = "release_bundle")` — so the rendering code path is well-exercised and stable. The OSS distribution simply doesn't pass that cargo feature when running `cargo bundle --bin warp-oss --features gui`, so `is_release_bundle()` returns false, `RELEASE_FLAGS` is never extended, and macOS OSS users lose IME entirely. Fix: insert `FeatureFlag::ImeMarkedText` unconditionally for macOS in `enabled_features()`, after the release-bundle gate. This matches the existing `#[cfg(target_os = "macos")]` guard in `RELEASE_FLAGS` so the behavior on Linux / Windows is unchanged (their marked-text paths are separate and gated by their own platform-specific work, e.g. warpdotdev#9602 for Linux/Wayland IME enable). ## Repro (before this patch) `cargo bundle --bin warp-oss --features gui --release`, install /Applications, launch in macOS, type pinyin into any TUI input (zsh, vim, Claude Code, etc.). Expected: Latin letters of the in-progress pinyin appear inline (often underlined). Actual: nothing appears until a Chinese candidate is committed. ## Verification `cargo check -p warp --bin warp-oss --features gui` clean. Manual repro on a re-built bundle: IME preedit now renders inline correctly. ## Notes This is functionally equivalent to passing `--features release_bundle` at build time, but scoped to just the IME rendering flag rather than also turning on `Autoupdate` / `Changelog` / `CrashReporting` / `SshRemoteServer` (which all have their own cargo-feature dependencies and may not be desired for OSS bundles).
Closes warpdotdev#9383. ### Description `set_ime_allowed(true)` was only being called inside the `#[cfg(windows)]` block in `crates/warpui/src/windowing/winit/window.rs::create_window` (the block that ends around line 1421 on master). On Linux/Wayland, winit's text-input plugin only sends `zwp_text_input_v3.enable()` to the compositor after `set_ime_allowed(true)` is called — without that call IME stays inactive, so non-Latin input methods (CJK in particular) appear to do nothing in Warp. ### Fix Add a parallel `#[cfg(target_os = "linux")]` block right after the Windows one calling the same method on the created window. macOS continues to use the native NSTextInputClient route and does not need this winit hint. A repo-wide grep for `set_ime_allowed` confirms there is no other Linux-specific call site that was already covering this — the previous behaviour was "Windows-only" by oversight, not by design. ```rust #[cfg(target_os = "linux")] if let Ok(window) = created_window.as_ref() { // On Linux/Wayland, winit only sends `zwp_text_input_v3.enable()` when IME is allowed, // so without this call IME stays inactive and non-Latin input (CJK, etc.) is unusable. window.set_ime_allowed(true); } ``` ### Testing - `cargo fmt -p warpui -- --check` — passes. - Compile-only verification possible from my checkout (Metal toolchain unavailable for full `cargo nextest`, mirroring warpdotdev#9277). The change is a 7-line addition that mirrors the existing Windows block exactly. - Functional verification needs a Wayland session, which I can't run locally; CI on Linux runners should cover compilation. A maintainer with a Wayland setup could confirm IME behaviour with a CJK input method. ### Coordination with warpdotdev#9536 PR warpdotdev#9536 (open) modifies the same file but inside `maybe_adjust_window_vertically` (lines ~1433+ on master, adding 3 lines that early-return on maximize/fullscreen). My edit lands in `create_window` on lines 1422–1428, which warpdotdev#9536 does not touch — no merge conflict expected. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries `CHANGELOG-BUG-FIX`: IME (input method) now activates on Linux/Wayland, restoring CJK and other non-Latin input that had been silently broken since first launch. Co-authored-by: anshul-garg27 <13553550+anshul-garg27@users.noreply.github.com>
…ndle (#2) Without this flag, `setMarkedText:` callbacks from the macOS input system are short-circuited inside the terminal view (`set_marked_text_on_terminal` returns early) and no IME preedit is ever drawn. That breaks text input for any user typing through an IME — CJK pinyin / wubi, Japanese kana / romaji, Korean hangul, dead-key Latin (French / German / Spanish / Vietnamese), macOS auto-correct candidates, emoji candidate windows, etc. Visible symptom: typing pinyin shows no Latin preedit characters in the input box; the only thing that ever appears is the final committed Chinese characters after picking a candidate. Effectively, CJK users can't type at all in OSS macOS builds. Stable / Preview macOS already get this flag via `RELEASE_FLAGS` because they build with `cfg!(feature = "release_bundle")` — so the rendering code path is well-exercised and stable. The OSS distribution simply doesn't pass that cargo feature when running `cargo bundle --bin warp-oss --features gui`, so `is_release_bundle()` returns false, `RELEASE_FLAGS` is never extended, and macOS OSS users lose IME entirely. Fix: insert `FeatureFlag::ImeMarkedText` unconditionally for macOS in `enabled_features()`, after the release-bundle gate. This matches the existing `#[cfg(target_os = "macos")]` guard in `RELEASE_FLAGS` so the behavior on Linux / Windows is unchanged (their marked-text paths are separate and gated by their own platform-specific work, e.g. warpdotdev#9602 for Linux/Wayland IME enable). ## Repro (before this patch) `cargo bundle --bin warp-oss --features gui --release`, install /Applications, launch in macOS, type pinyin into any TUI input (zsh, vim, Claude Code, etc.). Expected: Latin letters of the in-progress pinyin appear inline (often underlined). Actual: nothing appears until a Chinese candidate is committed. ## Verification `cargo check -p warp --bin warp-oss --features gui` clean. Manual repro on a re-built bundle: IME preedit now renders inline correctly. ## Notes This is functionally equivalent to passing `--features release_bundle` at build time, but scoped to just the IME rendering flag rather than also turning on `Autoupdate` / `Changelog` / `CrashReporting` / `SshRemoteServer` (which all have their own cargo-feature dependencies and may not be desired for OSS bundles).
Closes warpdotdev#9383. ### Description `set_ime_allowed(true)` was only being called inside the `#[cfg(windows)]` block in `crates/warpui/src/windowing/winit/window.rs::create_window` (the block that ends around line 1421 on master). On Linux/Wayland, winit's text-input plugin only sends `zwp_text_input_v3.enable()` to the compositor after `set_ime_allowed(true)` is called — without that call IME stays inactive, so non-Latin input methods (CJK in particular) appear to do nothing in Warp. ### Fix Add a parallel `#[cfg(target_os = "linux")]` block right after the Windows one calling the same method on the created window. macOS continues to use the native NSTextInputClient route and does not need this winit hint. A repo-wide grep for `set_ime_allowed` confirms there is no other Linux-specific call site that was already covering this — the previous behaviour was "Windows-only" by oversight, not by design. ```rust #[cfg(target_os = "linux")] if let Ok(window) = created_window.as_ref() { // On Linux/Wayland, winit only sends `zwp_text_input_v3.enable()` when IME is allowed, // so without this call IME stays inactive and non-Latin input (CJK, etc.) is unusable. window.set_ime_allowed(true); } ``` ### Testing - `cargo fmt -p warpui -- --check` — passes. - Compile-only verification possible from my checkout (Metal toolchain unavailable for full `cargo nextest`, mirroring warpdotdev#9277). The change is a 7-line addition that mirrors the existing Windows block exactly. - Functional verification needs a Wayland session, which I can't run locally; CI on Linux runners should cover compilation. A maintainer with a Wayland setup could confirm IME behaviour with a CJK input method. ### Coordination with warpdotdev#9536 PR warpdotdev#9536 (open) modifies the same file but inside `maybe_adjust_window_vertically` (lines ~1433+ on master, adding 3 lines that early-return on maximize/fullscreen). My edit lands in `create_window` on lines 1422–1428, which warpdotdev#9536 does not touch — no merge conflict expected. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries `CHANGELOG-BUG-FIX`: IME (input method) now activates on Linux/Wayland, restoring CJK and other non-Latin input that had been silently broken since first launch. Co-authored-by: anshul-garg27 <13553550+anshul-garg27@users.noreply.github.com> (cherry picked from commit 543d54e)
Closes warpdotdev#9383. ### Description `set_ime_allowed(true)` was only being called inside the `#[cfg(windows)]` block in `crates/warpui/src/windowing/winit/window.rs::create_window` (the block that ends around line 1421 on master). On Linux/Wayland, winit's text-input plugin only sends `zwp_text_input_v3.enable()` to the compositor after `set_ime_allowed(true)` is called — without that call IME stays inactive, so non-Latin input methods (CJK in particular) appear to do nothing in Warp. ### Fix Add a parallel `#[cfg(target_os = "linux")]` block right after the Windows one calling the same method on the created window. macOS continues to use the native NSTextInputClient route and does not need this winit hint. A repo-wide grep for `set_ime_allowed` confirms there is no other Linux-specific call site that was already covering this — the previous behaviour was "Windows-only" by oversight, not by design. ```rust #[cfg(target_os = "linux")] if let Ok(window) = created_window.as_ref() { // On Linux/Wayland, winit only sends `zwp_text_input_v3.enable()` when IME is allowed, // so without this call IME stays inactive and non-Latin input (CJK, etc.) is unusable. window.set_ime_allowed(true); } ``` ### Testing - `cargo fmt -p warpui -- --check` — passes. - Compile-only verification possible from my checkout (Metal toolchain unavailable for full `cargo nextest`, mirroring warpdotdev#9277). The change is a 7-line addition that mirrors the existing Windows block exactly. - Functional verification needs a Wayland session, which I can't run locally; CI on Linux runners should cover compilation. A maintainer with a Wayland setup could confirm IME behaviour with a CJK input method. ### Coordination with warpdotdev#9536 PR warpdotdev#9536 (open) modifies the same file but inside `maybe_adjust_window_vertically` (lines ~1433+ on master, adding 3 lines that early-return on maximize/fullscreen). My edit lands in `create_window` on lines 1422–1428, which warpdotdev#9536 does not touch — no merge conflict expected. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries `CHANGELOG-BUG-FIX`: IME (input method) now activates on Linux/Wayland, restoring CJK and other non-Latin input that had been silently broken since first launch. Co-authored-by: anshul-garg27 <13553550+anshul-garg27@users.noreply.github.com>
## Description Reverts #9602 ("Enable IME on Linux/Wayland"). This reverts merge commit `543d54ecc6766a1c863419ded39c26d97307f5b4`, which added a `#[cfg(target_os = "linux")]` block in `crates/warpui/src/windowing/winit/window.rs::create_window` calling `window.set_ime_allowed(true)`. ## Linked Issue Revert of #9602 (originally closed #9383). ## Testing - [ ] I have manually tested my changes locally with `./script/run` This is a pure `git revert` of the original commit, restoring the previous behavior on Linux/Wayland. I can't really reproduce this but it's the only commit that seems to affect IME on Linux and Wayland in the last release. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode [Conversation](https://staging.warp.dev/conversation/4326abed-5c34-4366-8ddd-5eb51039886d) <!-- CHANGELOG-NONE --> Co-authored-by: Abhishek Pandya <lilimmwilson@gmail.com> Co-authored-by: Oz <oz-agent@warp.dev>
Closes warpdotdev#9383. ### Description `set_ime_allowed(true)` was only being called inside the `#[cfg(windows)]` block in `crates/warpui/src/windowing/winit/window.rs::create_window` (the block that ends around line 1421 on master). On Linux/Wayland, winit's text-input plugin only sends `zwp_text_input_v3.enable()` to the compositor after `set_ime_allowed(true)` is called — without that call IME stays inactive, so non-Latin input methods (CJK in particular) appear to do nothing in Warp. ### Fix Add a parallel `#[cfg(target_os = "linux")]` block right after the Windows one calling the same method on the created window. macOS continues to use the native NSTextInputClient route and does not need this winit hint. A repo-wide grep for `set_ime_allowed` confirms there is no other Linux-specific call site that was already covering this — the previous behaviour was "Windows-only" by oversight, not by design. ```rust #[cfg(target_os = "linux")] if let Ok(window) = created_window.as_ref() { // On Linux/Wayland, winit only sends `zwp_text_input_v3.enable()` when IME is allowed, // so without this call IME stays inactive and non-Latin input (CJK, etc.) is unusable. window.set_ime_allowed(true); } ``` ### Testing - `cargo fmt -p warpui -- --check` — passes. - Compile-only verification possible from my checkout (Metal toolchain unavailable for full `cargo nextest`, mirroring warpdotdev#9277). The change is a 7-line addition that mirrors the existing Windows block exactly. - Functional verification needs a Wayland session, which I can't run locally; CI on Linux runners should cover compilation. A maintainer with a Wayland setup could confirm IME behaviour with a CJK input method. ### Coordination with warpdotdev#9536 PR warpdotdev#9536 (open) modifies the same file but inside `maybe_adjust_window_vertically` (lines ~1433+ on master, adding 3 lines that early-return on maximize/fullscreen). My edit lands in `create_window` on lines 1422–1428, which warpdotdev#9536 does not touch — no merge conflict expected. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries `CHANGELOG-BUG-FIX`: IME (input method) now activates on Linux/Wayland, restoring CJK and other non-Latin input that had been silently broken since first launch. Co-authored-by: anshul-garg27 <13553550+anshul-garg27@users.noreply.github.com>
) ## Description Reverts warpdotdev#9602 ("Enable IME on Linux/Wayland"). This reverts merge commit `50582e910b9149055a1962e59e6f74acc703dbb4`, which added a `#[cfg(target_os = "linux")]` block in `crates/warpui/src/windowing/winit/window.rs::create_window` calling `window.set_ime_allowed(true)`. ## Linked Issue Revert of warpdotdev#9602 (originally closed warpdotdev#9383). ## Testing - [ ] I have manually tested my changes locally with `./script/run` This is a pure `git revert` of the original commit, restoring the previous behavior on Linux/Wayland. I can't really reproduce this but it's the only commit that seems to affect IME on Linux and Wayland in the last release. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode [Conversation](https://staging.warp.dev/conversation/4326abed-5c34-4366-8ddd-5eb51039886d) <!-- CHANGELOG-NONE --> Co-authored-by: Abhishek Pandya <lilimmwilson@gmail.com> Co-authored-by: Oz <oz-agent@warp.dev>
Closes #9383.
Description
set_ime_allowed(true)was only being called inside the#[cfg(windows)]block incrates/warpui/src/windowing/winit/window.rs::create_window(the block that ends around line 1421 on master). On Linux/Wayland, winit's text-input plugin only sendszwp_text_input_v3.enable()to the compositor afterset_ime_allowed(true)is called — without that call IME stays inactive, so non-Latin input methods (CJK in particular) appear to do nothing in Warp.Fix
Add a parallel
#[cfg(target_os = "linux")]block right after the Windows one calling the same method on the created window. macOS continues to use the native NSTextInputClient route and does not need this winit hint.A repo-wide grep for
set_ime_allowedconfirms there is no other Linux-specific call site that was already covering this — the previous behaviour was "Windows-only" by oversight, not by design.Testing
cargo fmt -p warpui -- --check— passes.cargo nextest, mirroring Expand~inwarp://action/new_tab?path=URLs #9277). The change is a 7-line addition that mirrors the existing Windows block exactly.Coordination with #9536
PR #9536 (open) modifies the same file but inside
maybe_adjust_window_vertically(lines ~1433+ on master, adding 3 lines that early-return on maximize/fullscreen). My edit lands increate_windowon lines 1422–1428, which #9536 does not touch — no merge conflict expected.Server API
No server changes.
Agent Mode
Not applicable.
Changelog Entries
CHANGELOG-BUG-FIX: IME (input method) now activates on Linux/Wayland, restoring CJK and other non-Latin input that had been silently broken since first launch.