Skip to content

fix: ghost chars in cmd2, column display. - #158

Merged
sadsfae merged 2 commits into
quadsproject:developmentfrom
sadsfae:ghst
Jul 17, 2026
Merged

fix: ghost chars in cmd2, column display.#158
sadsfae merged 2 commits into
quadsproject:developmentfrom
sadsfae:ghst

Conversation

@sadsfae

@sadsfae sadsfae commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
  • Fix issues in readline rendering.

Navigating command history with arrow keys left remnant "ghost characters" on the prompt line.

Root cause: The shell's _rl() helper manually wrapped ANSI escape codes in readline non-printing markers (\x01/\x02), but cmd2 already does this automatically via rl_escape_prompt(). The double-wrapping produced orphan \x02 bytes that GNU readline counted as visible characters, inflating its prompt width calculation and causing incomplete redraws during history recall.

Fix: Removed _rl() and all manual \x01/\x02 wrapping from prompt construction. ANSI escape codes are now passed as raw sequences, letting cmd2 handle readline escaping.

Reported history bugs are just due to terminal size.

Assisted-by: claude

fixes: #154

* Fix issues in readline rendering.

Navigating command history with arrow keys left remnant "ghost characters" on the prompt line.

**Root cause:** The shell's `_rl()` helper manually wrapped ANSI escape codes in readline non-printing markers (`\x01`/`\x02`), but cmd2 already does this automatically via `rl_escape_prompt()`. The double-wrapping produced orphan `\x02` bytes that GNU readline counted as visible characters, inflating its prompt width calculation and causing incomplete redraws during history recall.

**Fix:** Removed `_rl()` and all manual `\x01`/`\x02` wrapping from prompt construction. ANSI escape codes are now passed as raw sequences, letting cmd2 handle readline escaping.

Reported history bugs are just due to terminal size.

Assisted-by: claude

fixes: quadsproject#154
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 80.10% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/quads_client/shell.py 43.19% <100.00%> (-0.20%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sadsfae
sadsfae merged commit c36ca17 into quadsproject:development Jul 17, 2026
5 checks passed
@sadsfae
sadsfae deleted the ghst branch July 17, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant