Skip to content

fix(native-term): match xterm desktop resize discipline, serialize per-terminal IPC, and emit post-resize snapshot - #746

Merged
chareice merged 1 commit into
mainfrom
fix/native-term-desktop-resize-discipline
Nov 28, 2026
Merged

chareice merged 1 commit into
mainfrom
fix/native-term-desktop-resize-discipline

Conversation

@chareice

Copy link
Copy Markdown
Collaborator

Eliminates Native Rust terminal line duplication (2-7x repeated lines) and stale-instance dimension drift by aligning desktop resize discipline with TerminalView.xterm.tsx and hardening Rust lifecycle:

  • Desktop resize discipline (TerminalView.native.tsx): Stop auto-fitting and sending { type: "resize" } on desktop open/reconnect (ws.onopen), initial loadFonts, and ResizeObserver mount/callback (matching TerminalView.xterm.tsx). Desktop resizes now only fire on explicit workspace layout actions / Fit menu / actual font preference changes, eliminating the Control-WS vs. Terminal-WS width race against initial_attach_snapshot().
  • Stable effects & module-level per-terminal IPC serialization (TerminalView.native.tsx): Stabilized fitToContainer, loadFonts, and ResizeObserver dependencies via refs, moved Tauri native_term_* serialization to a module-level per-terminalId queue so unmounting native_term_close cannot race a remount's native_term_open, and added dimension self-healing in applyFrame.
  • Fresh TermInstance on open (native_term.rs): native_term_open now always creates a fresh TermInstance (preventing stale scrollback/dimensions surviving ui-stable OTA reloads) and native_term_feed no longer silently creates a 120x36 fallback instance.
  • In-band post-resize snapshot (pty_daemon.rs): Emit a clean state_formatted() frame after CMD_RESIZE actually changes dimensions.

…r-terminal IPC, and emit post-resize snapshot
@chareice
chareice merged commit 8686c5c into main Nov 28, 2026
12 checks passed
@chareice
chareice deleted the fix/native-term-desktop-resize-discipline branch November 28, 2026 09:35
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