aboutsummaryrefslogtreecommitdiff
path: root/src/pane.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-04-14 02:17:56 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-04-14 02:17:56 +0300
commit8cac2c0df47af927b1c467fb8449d8f84e210407 (patch)
tree8682565afbf07b3ad5d4c6811f30c93cbc6e9cd1 /src/pane.rs
parentedaa3a1a092763cb25fd9e21772c95ee56a75a15 (diff)
feat support double prefix passthrough
Diffstat (limited to 'src/pane.rs')
-rw-r--r--src/pane.rs48
1 files changed, 34 insertions, 14 deletions
diff --git a/src/pane.rs b/src/pane.rs
index 74fec4e4..5e71e6c9 100644
--- a/src/pane.rs
+++ b/src/pane.rs
@@ -2387,31 +2387,51 @@ impl PaneRuntime {
Self::test_with_scrollback_bytes(cols, rows, 0, bytes)
}
+ pub(crate) fn test_with_screen_bytes_and_receiver(
+ cols: u16,
+ rows: u16,
+ bytes: &[u8],
+ ) -> (Self, mpsc::Receiver<Bytes>) {
+ Self::test_with_scrollback_bytes_and_receiver(cols, rows, 0, bytes)
+ }
+
pub(crate) fn test_with_scrollback_bytes(
cols: u16,
rows: u16,
scrollback_limit_bytes: usize,
bytes: &[u8],
) -> Self {
- let (tx, _rx) = mpsc::channel(4);
+ Self::test_with_scrollback_bytes_and_receiver(cols, rows, scrollback_limit_bytes, bytes).0
+ }
+
+ fn test_with_scrollback_bytes_and_receiver(
+ cols: u16,
+ rows: u16,
+ scrollback_limit_bytes: usize,
+ bytes: &[u8],
+ ) -> (Self, mpsc::Receiver<Bytes>) {
+ let (tx, rx) = mpsc::channel(4);
let (resize_tx, _resize_rx) = mpsc::channel(1);
let mut terminal =
crate::ghostty::Terminal::new(cols, rows, scrollback_limit_bytes).unwrap();
terminal.write(bytes);
- Self {
- terminal: Arc::new(PaneTerminal {
- ghostty: GhosttyPaneTerminal::new(terminal, tx.clone()).unwrap(),
- }),
- sender: tx,
- resize_tx,
- current_size: Cell::new((rows, cols)),
- child_pid: Arc::new(AtomicU32::new(0)),
- kitty_keyboard_flags: Arc::new(AtomicU16::new(0)),
- detect_reset_notify: Arc::new(Notify::new()),
- pending_release: Arc::new(Mutex::new(None)),
- detect_handle: tokio::spawn(async {}).abort_handle(),
- }
+ (
+ Self {
+ terminal: Arc::new(PaneTerminal {
+ ghostty: GhosttyPaneTerminal::new(terminal, tx.clone()).unwrap(),
+ }),
+ sender: tx,
+ resize_tx,
+ current_size: Cell::new((rows, cols)),
+ child_pid: Arc::new(AtomicU32::new(0)),
+ kitty_keyboard_flags: Arc::new(AtomicU16::new(0)),
+ detect_reset_notify: Arc::new(Notify::new()),
+ pending_release: Arc::new(Mutex::new(None)),
+ detect_handle: tokio::spawn(async {}).abort_handle(),
+ },
+ rx,
+ )
}
}