Skip to content

fix: keep terminal prompts on fresh lines - #79

Merged
kbuffardi merged 4 commits into
mainfrom
fix/terminal-prompt-newline-plan
Aug 22, 2026
Merged

fix: keep terminal prompts on fresh lines#79
kbuffardi merged 4 commits into
mainfrom
fix/terminal-prompt-newline-plan

Conversation

@kbuffardi

Copy link
Copy Markdown
Owner

Summary

  • track terminal line state across existing output paths so restored prompts cannot concatenate with visible output
  • make Clear/Ctrl+K discard typed input and redraw one prompt at the cleared screen top-left; preserve typed input for Ctrl+L
  • bump the extension patch version from 0.4.6 to 0.4.7

Validation

  • npm run lint
  • npm run test:e2e
  • npm run build
  • npm run version:check

Closes #78

@kbuffardi
kbuffardi requested a lite review from Copilot August 22, 2026 07:43
@kbuffardi
kbuffardi merged commit eef60d1 into main Aug 22, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are localized, match the linked issue’s acceptance criteria, and include targeted E2E coverage for the new prompt/newline behavior.

Pull request overview

This PR improves the terminal UI layer by making prompt redraws newline-aware, ensuring prompts never concatenate with existing visible output, and aligns clear-screen behaviors across UI/keyboard paths. It also bumps the extension version to reflect the fix release.

Changes:

  • Track whether the current terminal line already has visible content and prepend CRLF before writing a new prompt when needed.
  • Unify clear-screen behavior via clearScreen(), making Clear/Ctrl+K discard typed input and Ctrl+L preserve it while redrawing the prompt cleanly.
  • Add E2E coverage for prompt newline restoration and clear behavior; bump version from 0.4.6 to 0.4.7.
File summaries
File Description
src/ui/terminal.js Adds newline-aware prompt rendering and consolidated clear-screen logic with line-state tracking.
scripts/e2e-terminal-stop.test.mjs Adds E2E assertions for clear behavior and prompt restoration after newline-less output.
package.json Bumps extension/package version to 0.4.7.
package-lock.json Updates lockfile version fields to 0.4.7.
manifest.json Updates extension manifest version to 0.4.7.
Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Fix terminal prompt redraws to always start on a new line

2 participants