Skip to content

fix: mark tab dirty after shell exit#1585

Open
ddidderr wants to merge 4 commits into
raphamorim:mainfrom
ddidderr:fix
Open

fix: mark tab dirty after shell exit#1585
ddidderr wants to merge 4 commits into
raphamorim:mainfrom
ddidderr:fix

Conversation

@ddidderr
Copy link
Copy Markdown

@ddidderr ddidderr commented May 4, 2026

Closing a tab by exiting its shell removes the context in the CloseTerminal handler, but that path left the newly active tab with no pending update. The PTY performer already sends a follow-up RioEvent::Render, so a redraw is queued. However, Renderer::run still gates each panel on is_dirty or force_full_damage. When neither flag is set, the frame is discarded and the closed tab remains visible until another action dirties the screen.

Mark the new active screen dirty after resizing the tab line. This keeps the shell-exit path aligned with other UI mutation paths without adding another redraw request; the existing Render event supplies that.

Closing a tab by exiting its shell removes the context in the CloseTerminal
handler, but that path left the newly active tab with no pending update. The
PTY performer already sends a follow-up RioEvent::Render, so a redraw is
queued. However, Renderer::run still gates each panel on is_dirty or
force_full_damage. When neither flag is set, the frame is discarded and the
closed tab remains visible until another action dirties the screen.

Mark the new active screen dirty after resizing the tab line. This keeps the
shell-exit path aligned with other UI mutation paths without adding another
redraw request; the existing Render event supplies that.
Copilot AI review requested due to automatic review settings May 4, 2026 06:02
@ddidderr
Copy link
Copy Markdown
Author

ddidderr commented May 4, 2026

In simple words: You can now exit your shell with exit or Ctrl+d and the tab will immediately close instead of being still shown until you actively click another tab.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates RioTerm’s shell-exit tab-closing path so the window actually redraws after the active context changes. It aligns CloseTerminal handling with the renderer’s dirty-flag gating so exiting a shell no longer leaves the closed tab visible until a later UI event.

Changes:

  • Refactors the CloseTerminal non-window-close branch to work through a local screen binding.
  • Recomputes the tab-line layout using the remaining context count after a shell exits.
  • Marks the newly active screen dirty so the already-scheduled follow-up render is not skipped.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontends/rioterm/src/application.rs
@ddidderr
Copy link
Copy Markdown
Author

ddidderr commented May 4, 2026

I added a route.request_redraw(); because with use-fork = false my initial fix didn't work.

If you have a better idea, feel free to tell me / improve the PR yourself.

This reverts commit fe66569.
@ddidderr
Copy link
Copy Markdown
Author

ddidderr commented May 4, 2026

I added a route.request_redraw(); because with use-fork = false my initial fix didn't work.

If you have a better idea, feel free to tell me / improve the PR yourself.

Sorry, my bad. I was testing something else and forgot to include the fix from this PR and got overexcited and added the redraw which is - after testing again - not necessary.

@ddidderr ddidderr changed the title mark tab dirty after shell exit fix: mark tab dirty after shell exit May 4, 2026
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.

2 participants