Skip to content

emrg: TUI exit clears the terminal screen (rant 2026-08-18T11:13:17) - #839

Merged
argszero merged 2 commits into
masterfrom
feature/tui-exit-clear-screen
Aug 18, 2026
Merged

emrg: TUI exit clears the terminal screen (rant 2026-08-18T11:13:17)#839
argszero merged 2 commits into
masterfrom
feature/tui-exit-clear-screen

Conversation

@argszero

Copy link
Copy Markdown
Owner

TUI exit leaves the interface on screen — Terminal.shutdown() restored the title, exited raw mode and moved the cursor home, but never emitted CLEAR_SCREEN, so the rendered content stayed visible after emrg quit (unlike Codex/Claude Code which clear on exit).

Changes

  • emrg/client/python_tui/terminal.py: shutdown() emits CLEAR_SCREEN (\x1b[2J) before CURSOR_HOME
  • tests/test_terminal_render.py: new test_shutdown_clears_screen asserting CLEAR_SCREEN is emitted and precedes cursor-home
  • Agent.md: Python test count 933→934

Root cause (as located in the rant): shutdown() only did restore_title + raw-mode exit + CURSOR_SHOW + CURSOR_HOME + RESET_SCROLL_REGION + bracketed-paste off; the screen buffer was never cleared.

Terminal.shutdown() only moved the cursor home — the TUI content stayed on
screen after exit. Emit CLEAR_SCREEN (\x1b[2J) before CURSOR_HOME so the
terminal is wiped on exit (matching Codex/Claude Code behavior). Adds a
shutdown test asserting CLEAR_SCREEN emission and ordering.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 708 (1/3). CI test + test-windows PASS (32103591972). TUI exit now clears the screen; test_shutdown_clears_screen asserts CLEAR_SCREEN before CURSOR_HOME.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 709 (2/3). Head dd22244, CI test + test-windows PASS (32103591972). Terminal.shutdown CLEAR_SCREEN + ordering test verified.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 710 (3rd). Head e094f68 (conflict resolved: Agent.md 934 pytest + 258 GUI merged from #838/#840), CI test + test-windows PASS (32106113119), MERGEABLE/CLEAN. Three consecutive LGTMs (708/709/710), no ❌ — merging.

@argszero
argszero merged commit 7a56531 into master Aug 18, 2026
2 checks passed
argszero pushed a commit that referenced this pull request Aug 18, 2026
argszero added a commit that referenced this pull request Aug 18, 2026
v0.2.47 -> v0.2.48 across 8 files / 9 refs (standard release bump):
- emrg/__init__.py, pyproject.toml, uv.lock (emrg entry)
- emrg/gui/package.json + package-lock.json (x2)
- packaging/build-runtime.sh, make-installer.sh, make-run-installer.sh

Covers 4 commits since v0.2.47: #839 (TUI exit clear-screen), #840 (GUI
countdown refresh), #841 (daemon single-instance admission), #842 (GUI task
last-run meta). Rant 2026-08-18T14:46:47.

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/tui-exit-clear-screen branch August 18, 2026 13:09
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