Skip to content

fix: restarting a pane's program starts its agent again with clean terminal modes - #64

Merged
nyxene merged 1 commit into
masterfrom
fix/60-restart-program
Oct 18, 2026
Merged

nyxene merged 1 commit into
masterfrom
fix/60-restart-program

Conversation

@nyxene

@nyxene nyxene commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Closes #60

Isolation… → [r] save and restart the program had two faults. The agent was typed again only when a confirmed session id was recorded; otherwise the pane was left at a bare shell. restart_command now falls back to the detected agent's program, through the same restored_command/restore_line path a server start uses. And the restarted pane reused the old emulator with its modes, so mouse reporting stayed on and every mouse move printed 35;…M into the shell. Term::modes_off turns mouse, bracketed paste, cursor/keypad, alternate screen, kitty keyboard and focus modes off while keeping the screen text; reshell_pane had the same reuse and gets the same reset.

Tests: a_restarted_agent_starts_again_without_a_session, a_restarted_pane_starts_with_the_old_programs_modes_off (both red without the change). Live on a test server: mouse on → restart → motion events → clean prompt; pi running → restart → a new pi process started by the new shell. scripts/gates.sh exit 0.

🤖 Generated with Claude Code

…rminal modes

Restart now types the agent the pane ran when it has no session to resume,
and the kept screen leaves the old program's mouse, paste, cursor, keypad and
alternate-screen modes behind, so mouse moves no longer land in the shell.
The same reset runs when a command leaves and the shell comes back.

Closes #60

Co-Authored-By: Claude <noreply@anthropic.com>
@nyxene
nyxene merged commit c1e398e into master Oct 18, 2026
1 check passed
@nyxene
nyxene deleted the fix/60-restart-program branch October 18, 2026 21:33
nyxene added a commit that referenced this pull request Oct 18, 2026
…gin, insert and charset (#68)

Closes #66

Found in review of #64: `Term::modes_off` reset the input modes and the
alternate screen but not the scroll region (DECSTBM), origin mode,
insert mode or the G0 charset, so a TUI killed mid-redraw by Isolation…
→ [r] could leave the new shell confined to part of the screen or
printing line-drawing glyphs. The reset now covers them, around a cursor
save/restore because `CSI r` moves the cursor home; the no-op kitty
keyboard sequence is gone. `requeue` clears a stale `via`, so a message
queued again after a failed hand-over counts as unread.

Test: `modes_off_leaves_a_fresh_terminal_with_the_text_kept` in
src/term.rs (red without the new sequences, green with them).
`scripts/gates.sh` exit 0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
nyxene pushed a commit that referenced this pull request Oct 18, 2026
Release pull request, maintained by release-please. Merging it creates
the tag and a draft GitHub release; then run `scripts/publish-binary.sh
vX.Y.Z` from a terminal to attach the macOS binary and publish the
release.
---


## [0.12.4](v0.12.3...v0.12.4)
(2026-10-18)


### Fixed

* a message an agent has taken no longer counts as unread
([#61](#61))
([2680e48](2680e48))
* a restarted pane also drops the old program's scroll region, origin,
insert and charset ([#68](#68))
([7bc0f18](7bc0f18))
* pi reaches every provider it ships with in an Only these providers
pane ([#62](#62))
([4e8a5e1](4e8a5e1))
* pi starts with its models in a pane set to this folder only
([#63](#63))
([e92d5fb](e92d5fb))
* pi's provider list leaves out the Cloudflare hosts that relay any URL
([#69](#69))
([17d833c](17d833c))
* restarting a pane's program starts its agent again with clean terminal
modes ([#64](#64))
([c1e398e](c1e398e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Save and restart the program leaves a bare shell and the old program's mouse mode

1 participant