Symptom
After submitting a command, the previous prompt line gains an extra [:
[[archon:default:T1] ❯ previous-command
[archon:default:T1] ❯
Reproduction
- Run
archon in a TTY
- Type any command (e.g.
status, help) and press Enter
- Observe the previous prompt line in the scroll buffer
Investigation
Attempted fix: replaced all rl.prompt() display calls with direct process.stdout.write(ps1) to bypass readline's _refreshLine() cursor arithmetic (commit 4218e38). The artifact persists.
Suspected cause: readline's internal prevRows tracker becomes desynced from the actual cursor when process.stdout.write('\n') is called externally. On the next _refreshLine() invocation, the cursor targets the wrong row and writes the prompt starting at col 1 instead of col 0, leaving the old [ at col 0 visible.
Files
-packages/cli/src/tui/shell.ts
-packages/cli/src/tui/notifications/manager.ts
-packages/cli/src/tui/prompt.ts
References
nodejs/node-v0.x-archive#3860
Symptom
After submitting a command, the previous prompt line gains an extra
[:Reproduction
archonin a TTYstatus,help) and press EnterInvestigation
Attempted fix: replaced all
rl.prompt()display calls with directprocess.stdout.write(ps1)to bypass readline's_refreshLine()cursor arithmetic (commit 4218e38). The artifact persists.Suspected cause: readline's internal
prevRowstracker becomes desynced from the actual cursor whenprocess.stdout.write('\n')is called externally. On the next_refreshLine()invocation, the cursor targets the wrong row and writes the prompt starting at col 1 instead of col 0, leaving the old[at col 0 visible.Files
-
packages/cli/src/tui/shell.ts-
packages/cli/src/tui/notifications/manager.ts-
packages/cli/src/tui/prompt.tsReferences
nodejs/node-v0.x-archive#3860