Skip to content

bug(cli): extra character rendered on prompt line after Enter #2

Description

@AndrewPHunter

Symptom

After submitting a command, the previous prompt line gains an extra [:

[[archon:default:T1] ❯  previous-command
[archon:default:T1] ❯

Reproduction

  1. Run archon in a TTY
  2. Type any command (e.g. status, help) and press Enter
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions