From d54b90b03718fc0cbe4f65ff8345bdc555f5860a Mon Sep 17 00:00:00 2001 From: David Poblador i Garcia Date: Fri, 29 May 2026 09:57:02 +0200 Subject: [PATCH] fix(terminal): restore scrollback by reverting tmux alternate-screen overrides Commit a455855 added `alternate-screen off` and a `smcup@:rmcup@` terminal-override to get native trackpad scroll in tmux terminals. The side effect is that the Coding Agent's TUI redraws dump full-screen content into the scrollback buffer, causing disorienting jumps with duplicated content. Revert both settings so inner programs use their own alternate screen and scrollback stays clean. This re-accepts the trackpad-scroll regression (Ghostty converts scroll to arrow keys inside the alternate screen); users can navigate with Shift+scroll or the keyboard. Drop the two tests that asserted the reverted settings. Closes #395 Co-Authored-By: Claude Opus 4.8 (1M context) --- Sources/Models/TmuxSession.swift | 2 -- Tests/TmuxSessionTests.swift | 8 -------- 2 files changed, 10 deletions(-) diff --git a/Sources/Models/TmuxSession.swift b/Sources/Models/TmuxSession.swift index 48fdd112..52e3197c 100644 --- a/Sources/Models/TmuxSession.swift +++ b/Sources/Models/TmuxSession.swift @@ -36,8 +36,6 @@ enum TmuxSession { set -g extended-keys on set -g default-terminal "xterm-256color" set -ga terminal-features ',*:extkeys' - set -ga terminal-overrides ',*:smcup@:rmcup@' - set -g alternate-screen off set -g aggressive-resize on set -g window-size latest set -g remain-on-exit on diff --git a/Tests/TmuxSessionTests.swift b/Tests/TmuxSessionTests.swift index 7fc6ce23..ced8789b 100644 --- a/Tests/TmuxSessionTests.swift +++ b/Tests/TmuxSessionTests.swift @@ -10,14 +10,6 @@ final class TmuxSessionTests: XCTestCase { XCTAssertFalse(TmuxSession.configContents.contains("set -g mouse on")) } - func testConfigKeepsOuterTerminalOutOfAlternateScreen() { - XCTAssertTrue(TmuxSession.configContents.contains("set -ga terminal-overrides ',*:smcup@:rmcup@'")) - } - - func testConfigDisablesPaneAlternateScreen() { - XCTAssertTrue(TmuxSession.configContents.contains("set -g alternate-screen off")) - } - func testConfigDoesNotGloballyRespawnDeadPanes() { XCTAssertFalse(TmuxSession.configContents.contains("pane-died")) XCTAssertTrue(TmuxSession.configContents.contains("set -g remain-on-exit on"))