Slash command completion erases last character of input in narrow terminals
Description
When the terminal window is narrower than the full set of slash command completion options, typing a slash command (e.g., /vbw:vibe) and pressing space causes the last character of the command to be visually erased when the completion dropdown appears. In this case, /vbw:vibe renders as /vbw:vib once the options are shown.
Steps to Reproduce
- Resize terminal window to be narrower than the completion options dropdown (below ~80 columns)
- Start typing a slash command with completion options, e.g.
/vbw:vibe - Press space to trigger completion/options display
- Observe: the last letter ("e" in "vibe") disappears from the input field when the options appear
Expected Behavior
The full command text (/vbw:vibe) should remain visible in the input field when completion options are displayed, regardless of terminal width.
Actual Behavior
The last character of the typed command is erased/overwritten when the completion dropdown renders in a narrow terminal.
Environment
- Claude Code version: 2.1.42
- Platform: macOS arm64 (Darwin 25.2.0)
- Terminal: Standard terminal, reproduced at widths below ~80 columns
Possibly Related Prior Fixes
- v2.1.39: "Fixed character loss at terminal screen boundary"
- v2.1.20: "Fixed wide character rendering artifacts where trailing columns were not cleared when replaced by narrower characters"
- v2.1.20: "Fixed ghost text flickering when typing slash commands mid-input"
- v2.1.31: "Narrow terminal layout for prompt footer"
This appears to be a remaining edge case in the same area — the completion dropdown rendering logic may be miscalculating the available width and truncating or overwriting the input field's trailing character.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗