Skip to content

Use DEC cursor restore for status rendering#40

Open
otaku46 wants to merge 2 commits into
Helvesec:mainfrom
otaku46:status-refresh-cursor-restore
Open

Use DEC cursor restore for status rendering#40
otaku46 wants to merge 2 commits into
Helvesec:mainfrom
otaku46:status-refresh-cursor-restore

Conversation

@otaku46

@otaku46 otaku46 commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Use DEC cursor save/restore (ESC 7 / ESC 8) when rendering status-only frames instead of CSI save/restore (CSI s / CSI u).

This keeps status refresh rendering from leaving the terminal cursor on the status row in terminals where CSI s/u does not restore
the expected cursor position during periodic redraws.

Motivation

Attached clients periodically refresh the status line according to status-interval. That refresh path only redraws the status row,
so it must preserve the pane cursor position exactly.

In iTerm2/Ghostty, I observed the cursor moving to the top/status row after the periodic status refresh fired. Disabling the timer
with status-interval 0 avoids the issue, which points to the status-only redraw path.

DEC save/restore is a more conservative terminal sequence for this use case and matches the intent without changing the rendered
status content.

Testing

  • cargo test -p rmux-server renderer::
  • cargo test -p rmux-server bracketed_paste

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