macOS: per-pane independent keyboard input source (IME) support#12439
macOS: per-pane independent keyboard input source (IME) support#12439zc911 wants to merge 1 commit into
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: chenzhen48.
|
|
Every PR must be linked to a same-repo issue before Oz can review it. This PR is linked to #12316, but no linked issue is marked See the contribution guidelines for the full readiness model. Powered by Oz |
There was a problem hiding this comment.
Every PR must be linked to a same-repo issue before Oz can review it.
This PR is linked to #12316, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.
See the contribution guidelines for the full readiness model.
Powered by Oz
When switching focus between split panes, each pane now remembers and restores its own macOS keyboard input source (e.g., English ABC in one pane, Chinese Pinyin in another). - Adds get_current_input_source_id() and select_input_source() to the macOS ObjC keycode bridge, with [NSThread isMainThread] guards to ensure Carbon TIS APIs are only called from the main thread. - Exposes these as Window::get_current_input_source_id() and Window::select_input_source() in the Rust FFI layer. - PaneGroupFocusState stores a HashMap<PaneId, String> mapping each pane to its last known input source ID. On focus change, it saves the departing pane's source and restores the incoming pane's source. - New panes inherit the current system input source on first focus. - Feature is macOS-only via #[cfg(target_os = "macos")]. Closes warpdotdev#12316
c4d9647 to
ebf66e4
Compare
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @zc911 on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Summary
When switching focus between split panes on macOS, each pane now remembers and restores its own keyboard input source (IME). This eliminates the need to manually toggle input methods when working in bilingual/multilingual workflows across panes.
For example: English input (ABC) in the left pane for terminal commands, Chinese Pinyin in the right pane for documentation — each pane keeps its own IME state independently.
Closes #12316
Changes
keycode.m— Addedget_current_input_source_id()andselect_input_source()with[NSThread isMainThread]guardswindow.rs— FFI declarations + Rust wrapper methods onWindowfocus_state.rs—HashMap<PaneId, String>to store per-pane input source state, with save/restore on focus changeDesign decisions
PaneId-based mechanism[NSThread isMainThread]guard prevents Carbon TIS API crashes on background threads#[cfg(target_os = "macos")]Testing
cargo check -p warp— passescargo test -p warp -- "pane_group::"— 106 passed, 0 failed (parallel)🤖 Generated with Claude Code