Conversation
The composer hint is drawn whenever the editor's buffer is empty. An IME does not put its preedit in that buffer: the terminal holds it and paints it at the cursor itself. So while pinyin is being composed the buffer is still empty, the editor keeps rewriting the hint into the cells the terminal is also drawing the composing text into, and the two layers alternate on the same cells. Visually the hint does not hide and the row flickers. No terminal reports composition start or end to the application, so the suppression has to be inferred. A printable keystroke that reaches the editor and leaves the buffer empty is exactly that: text the editor did not consume is still with the terminal. Such a keystroke hides the hint for 500ms and re-arms on the next one, so a whole composition stays covered; committing into the buffer, or abandoning the composition and letting the timer expire, brings the hint back. Keystrokes that type nothing (arrows, Escape, Ctrl chords) do not arm it, and the bash-mode hints follow a typed `!` prefix, so they are unaffected. Covered by four cases in step-editor.test.ts: a composition stays hidden across keystrokes and the hint returns on the deadline, committed text and programmatic fills clear the state, non-composing keystrokes leave the hint alone, and the bash-mode hint survives the idle suppression. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
The composer hint (
Ask Step to do anything …) is drawn whenever the editor's buffer is empty. An IME does not put its preedit in that buffer — the terminal holds it and paints it at the cursor itself. So while pinyin is being composed the buffer is still empty, the editor keeps rewriting the hint into the cells the terminal is also drawing the composing text into, and the two layers alternate on the same cells. The hint does not hide and the row flickers as you type.Change
No terminal reports composition start or end to the application, and the preedit never reaches stdin, so the suppression has to be inferred from what does arrive. A printable keystroke that reaches the editor and leaves the buffer empty is exactly that signal: text the editor did not consume is still with the terminal.
!/!!prefix, which is already text, so they are unaffected.Scope:
apps/clionly.packages/tuiis untouched — the product layer owns the Step composer's hint, and pi-tui keeps its own state machine.Testing
apps/cli/test/step-editor.test.ts— four new cases: a composition stays hidden across keystrokes and the hint returns on the deadline, committed text and programmatic fills clear the state, non-composing keystrokes leave the hint alone, and the bash-mode hint survives the idle suppression.apps/clisuite: 628 passed.pnpm run check— passes../test.sh— 3453 passed, 1 failed. The failure istest/subagent-invocation.test.ts:48, which spawns the CLI and hits atsx createIpcServerEINVALon its IPC pipe under the harness'senv -iisolation. Verified pre-existing: a cleanmaintree fails identically in the same isolated environment, and the test passes outside it.Notes
The 500 ms window is deliberately short — it only has to cover the gaps between the keystrokes of one composition. A slow typist entering their first character sees the hint step aside for half a second and come back; that is a smaller cost than the flicker, and it is the only observable that distinguishes a composition from typing without terminal cooperation.