the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
fix: preserve logical lines in scrollback editor (#2735)
akbash952729ee03e0
diff --git a/docs/next/CHANGELOG.md b/docs/next/CHANGELOG.mdindex 7fd6135c8..07a46609f 100644--- a/docs/next/CHANGELOG.md+++ b/docs/next/CHANGELOG.md@@ -20,6 +20,7 @@- Experimental pane graphics now support bounded named layers, acknowledged full-RGBA primary-layer direct file frames on audited local terminals, owned BGRA fallback, exact pixel mouse input, and placement-only resize replay.### Fixed+- `prefix+e` now preserves logical lines when opening soft-wrapped scrollback in an editor. (#2733)- Prefix keybindings now disambiguate layout-aware shifted punctuation, so a shifted `\` no longer triggers `prefix+|` on keyboard layouts where the same key produces both characters. (#2674)- Remote clients now continue redrawing at very large terminal sizes instead of freezing when a full ANSI frame exceeds the transport limit. (#2670)- OpenCode panes now track the root conversation selected in their own TUI for native restore without adopting activity from attached clients. (#2450)diff --git a/src/app/input/navigate.rs b/src/app/input/navigate.rsindex beb2f363f..afe9e6e0b 100644--- a/src/app/input/navigate.rs+++ b/src/app/input/navigate.rs@@ -975,7 +975,8 @@ impl App {.state.runtime_for_pane_in_workspace(&self.terminal_runtimes, ws_idx, pane_id).ok_or_else(|| std::io::Error::other("focused pane has no scrollback runtime"))?- .recent_text(usize::MAX);+ .recent_unwrapped_text_snapshot(usize::MAX)+ .text;let path = write_scrollback_temp_file(&scrollback)?;@@ -3661,7 +3662,7 @@ navigate_pane_down = "ctrl+j"#[cfg(unix)]#[tokio::test]- async fn edit_scrollback_key_opens_focused_runtime_scrollback_in_editor_pane() {+ async fn edit_scrollback_key_preserves_logical_lines_in_editor_pane() {let (_api_tx, api_rx) = tokio::sync::mpsc::unbounded_channel();let mut app = App::new(&Config::default(),@@ -3675,10 +3676,10 @@ navigate_pane_down = "ctrl+j"workspace.tabs[0].runtimes.insert(root_pane,crate::terminal::TerminalRuntime::test_with_scrollback_bytes(- 20,+ 5,5,4096,- b"alpha\nbeta\n",+ b"ABCDEFGHIJ\r\nKLMNO",),);app.state.workspaces = vec![workspace];@@ -3708,8 +3709,7 @@ navigate_pane_down = "ctrl+j"}let content = wait_for_file(&output_path);- assert!(content.contains("alpha"));- assert!(content.contains("beta"));+ assert_eq!(content, "ABCDEFGHIJ\nKLMNO");assert_eq!(app.state.mode, Mode::Terminal);assert!(app.state.terminals.values().any(|terminal| terminaldiff --git a/src/pane.rs b/src/pane.rsindex 83921ab08..44f3fea9d 100644--- a/src/pane.rs+++ b/src/pane.rs@@ -2727,10 +2727,6 @@ impl PaneRuntime {self.terminal.agent_osc_progress()}- pub fn recent_text(&self, lines: usize) -> String {- self.terminal.recent_text(lines)- }-pub(crate) fn recent_text_snapshot(&self, lines: usize) -> TerminalReadSnapshot {self.terminal.recent_text_snapshot(lines)}diff --git a/src/pane/terminal.rs b/src/pane/terminal.rsindex 3524df210..b853f0b03 100644--- a/src/pane/terminal.rs+++ b/src/pane/terminal.rs@@ -427,10 +427,6 @@ impl PaneTerminal {self.ghostty.detection_text()}- pub fn recent_text(&self, lines: usize) -> String {- self.ghostty.recent_text(lines)- }-pub(crate) fn recent_text_snapshot(&self, lines: usize) -> TerminalReadSnapshot {self.ghostty.recent_text_snapshot(lines)}@@ -1959,6 +1955,7 @@ impl GhosttyPaneTerminal {.unwrap_or_default()}+ #[cfg(test)]pub fn recent_text(&self, lines: usize) -> String {self.recent_text_snapshot(lines).text}diff --git a/src/terminal/runtime.rs b/src/terminal/runtime.rsindex 89544a742..156d18fdd 100644--- a/src/terminal/runtime.rs+++ b/src/terminal/runtime.rs@@ -361,10 +361,6 @@ impl TerminalRuntime {self.0.agent_osc_progress()}- pub fn recent_text(&self, lines: usize) -> String {- self.0.recent_text(lines)- }-pub(crate) fn recent_text_snapshot(&self, lines: usize) -> crate::pane::TerminalReadSnapshot {self.0.recent_text_snapshot(lines)}