Skip to content

fix: pass Flutter view id to text input - #224

Open
Chris533 wants to merge 1 commit into
TerminalStudio:masterfrom
Chris533:patch-1
Open

Chris533 wants to merge 1 commit into
TerminalStudio:masterfrom
Chris533:patch-1

Conversation

@Chris533

Copy link
Copy Markdown

Summary

Fix Windows IME input for CustomTextEdit by passing the current Flutter viewId into
TextInputConfiguration.

Problem

On Windows, TextInput.setClient can fail with:

PlatformException(Bad Arguments, Could not set client, view ID is null.)

When that happens, IME text input (for example Chinese input) does not work.

Change

Add:

viewId: View.of(context).viewId,

to the TextInputConfiguration used by CustomTextEdit.

Validation

Tested on Flutter Windows desktop:

  • English keyboard input works
  • Chinese IME input works
  • Paste still works

ShlomiPorush added a commit to Tildeck/tildeck that referenced this pull request Sep 30, 2026
## What

Shlomi reported that on Windows the terminal connected but accepted no
typing.

- Cause: xterm 4.0.0 opens its keyboard connection
(`TextInput.setClient`) without a view id. Flutter's Windows embedder
rejects that since 3.44, and the terminal then drops every typed
character. The fix is known upstream (TerminalStudio/xterm.dart#224,
#228, #231) but was never merged or released.
- Fix: the app depends on a copy of xterm 4.0.0 in
`app/third_party/xterm` with the one-line patch; `PATCHES.md` records it
and when to drop the copy.

## Verification

- `app/test/terminal_input_test.dart` checks the configuration sent to
the platform: it failed before the patch (`viewId` null) and passes
after.
- `app/test/terminal_typing_test.dart` fills in the connection form,
connects to the throwaway OpenSSH server, trusts its key, types a
command, and sees it run.
- `scripts/verify.sh --area app` passes (28 tests, debug APK);
`scripts/windows.ps1 build` passes.

## Not verified here

Typing in the real Windows window: the automation session cannot send
keystrokes to it. Shlomi confirms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant