You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] text: submitted value line is indented 2 spaces while active input is flush-left under withGuide: false (content shifts right on submit) #598
CJK input used in the example, but the shift happens with ASCII input too (any text prompt value)
Minimal repro
import*asclackfrom'@clack/prompts'clack.updateSettings({withGuide: false})awaitclack.text({message: '插件包名'})// type 测, then press Enter
Observed
While the prompt is active, the input row is rendered flush-left:
◆ 插件包名
测█ ← cursor block right after the text, column 0 + displayWidth
After pressing Enter, the submitted (final) frame re-renders the value line with a 2-space indent:
◇ 插件包名
测 ← shifted right by 2 columns
So with withGuide: false, every text submit makes the content visibly jump 2 columns to the right.
With the default withGuide: true, both renderings carry the same │ prefix (3 columns), so the frames are consistent — the inconsistency only appears when the guide is turned off, because the submit branch keeps a 2-space indent (the leftover of the old │ prefix) while userInputWithCursor renders flush-left.
Byte streams (PTY capture, 80 cols)
Last redraw while typing 测 (active state, flush-left):
\x1b[999D\x1b[3A\x1b[1B\x1b[2K\x1b[G测█\x1b[2B
Full output after Enter (submit frame, 2-space-indented value line):
The before the dimmed value in the submit frame is the discrepancy: no such prefix exists in the active render.
Expected
Under withGuide: false, the submitted value line should be rendered flush-left like the active input row (i.e. no 2-space carry-over), so the frame doesn't shift on submit.
Notes
Found while building a PTY-based CJK cursor regression harness; happy to send a PR if the fix direction (skip the 2-space indent on the submit branch when settings.withGuide === false) sounds right.
Activity
fix: output submit gap only when guide enabled