aboutsummaryrefslogtreecommitdiff
path: root/src/pane
diff options
context:
space:
mode:
Diffstat (limited to 'src/pane')
-rw-r--r--src/pane/terminal.rs22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/pane/terminal.rs b/src/pane/terminal.rs
index 438c3037..b90c63f1 100644
--- a/src/pane/terminal.rs
+++ b/src/pane/terminal.rs
@@ -130,7 +130,11 @@ impl InputState {
}
pub fn plain_page_keys_use_host_scrollback(self) -> bool {
- !self.alternate_screen && !self.mouse_reporting_enabled() && !self.application_cursor
+ !self.alternate_screen
+ && !self.mouse_reporting_enabled()
+ // Bracketed paste distinguishes zsh's line editor (where it's on)
+ // from e.g. less -X (where it's off).
+ && (!self.application_cursor || self.bracketed_paste)
}
}
@@ -3073,6 +3077,22 @@ mod tests {
use ratatui::{layout::Rect, style::Color};
use tokio::sync::mpsc;
+ #[test]
+ fn plain_page_keys_host_scroll_for_shell_like_decckm_with_bracketed_paste() {
+ assert!(InputState {
+ alternate_screen: false,
+ application_cursor: true,
+ bracketed_paste: true,
+ focus_reporting: false,
+ mouse_protocol_mode: crate::input::MouseProtocolMode::None,
+ mouse_protocol_encoding: crate::input::MouseProtocolEncoding::Default,
+ mouse_alternate_scroll: false,
+ modify_other_keys: false,
+ color_scheme_reporting: false,
+ }
+ .plain_page_keys_use_host_scrollback());
+ }
+
fn text_cell(text: &str) -> crate::ghostty::ScreenTextCell {
crate::ghostty::ScreenTextCell {
wide: crate::ghostty::CellWide::Narrow,