Summary
When the input line fills the prompt width exactly and the user keeps typing, the new character + cursor become invisible. The buffer is correct — pressing Enter submits the full text including the invisible suffix — so this is a pure rendering issue.
Environment
- Gemini CLI: 0.39.1
- OS: Windows 11
- Shell: PowerShell (Windows Terminal)
- Terminal size: 50 columns × 5 rows
- Plan mode active
ui.terminalBuffer: true in ~/.gemini/settings.json
Reproduction
- Resize the terminal to ~50 columns (the exact width is not critical, only that the test string ends up matching
inputWidth).
- At the input prompt type
parola repeatedly until the line is full, then continue with pa. The cursor sits at the right edge.
- Type one more character (e.g.
r).
Expected
The prompt grows to a second visual line and shows par plus the cursor on it.
Observed
The new character and cursor disappear; the visible line still ends with pa. The text is in the buffer — Enter submits the full string parola parola parola parola parola parola parola par.
Root cause
VirtualizedList (used by ScrollableList to render the input lines when ui.terminalBuffer: true) applies paddingRight: 1 for its scroll gutter (packages/cli/src/ui/components/shared/VirtualizedList.tsx:738). The input prompt was passing width={inputWidth} to ScrollableList (packages/cli/src/ui/components/InputPrompt.tsx:1865), so the inner content area was inputWidth - 1. A visual line exactly inputWidth chars wide had its last char clipped.
Fix
Compensate for the gutter by passing width={inputWidth + 1} to ScrollableList, so the inner content area equals inputWidth. The fix is staged on branch fix/inputprompt-wrap-truncates-last-char on my fork (commit e9f20f206) with a regression test; I'll open the PR once one of my existing open PRs is reviewed/merged.
Notes
- Only the
ui.terminalBuffer: true render path is affected. The fallback render path (InputPrompt.tsx:1875-1891) does not go through VirtualizedList and renders correctly.
Summary
When the input line fills the prompt width exactly and the user keeps typing, the new character + cursor become invisible. The buffer is correct — pressing Enter submits the full text including the invisible suffix — so this is a pure rendering issue.
Environment
ui.terminalBuffer: truein~/.gemini/settings.jsonReproduction
inputWidth).parolarepeatedly until the line is full, then continue withpa. The cursor sits at the right edge.r).Expected
The prompt grows to a second visual line and shows
parplus the cursor on it.Observed
The new character and cursor disappear; the visible line still ends with
pa. The text is in the buffer — Enter submits the full stringparola parola parola parola parola parola parola par.Root cause
VirtualizedList(used byScrollableListto render the input lines whenui.terminalBuffer: true) appliespaddingRight: 1for its scroll gutter (packages/cli/src/ui/components/shared/VirtualizedList.tsx:738). The input prompt was passingwidth={inputWidth}toScrollableList(packages/cli/src/ui/components/InputPrompt.tsx:1865), so the inner content area wasinputWidth - 1. A visual line exactlyinputWidthchars wide had its last char clipped.Fix
Compensate for the gutter by passing
width={inputWidth + 1}toScrollableList, so the inner content area equalsinputWidth. The fix is staged on branchfix/inputprompt-wrap-truncates-last-charon my fork (commite9f20f206) with a regression test; I'll open the PR once one of my existing open PRs is reviewed/merged.Notes
ui.terminalBuffer: truerender path is affected. The fallback render path (InputPrompt.tsx:1875-1891) does not go throughVirtualizedListand renders correctly.