id
stringlengths
20
30
source
stringclasses
1 value
chunk_index
int64
0
520k
token_count
int32
154
512
content
stringlengths
185
57.5k
rust_dataset_chunk_516200
rust_dataset.txt
516,200
512
client_id: 100, pane_ids: vec![zellij_utils::data::PaneId::Terminal(0)], scrollback: None, ansi: false, }); std::thread::sleep(std::time::Duration::from_millis(100)); let _ = mock_screen .to_screen .send(ScreenInstruction::RenderToClients)...
rust_dataset_chunk_516201
rust_dataset.txt
516,201
512
.to_screen .send(ScreenInstruction::SubscribeToPaneRenders { client_id: 100, pane_ids: vec![zellij_utils::data::PaneId::Terminal(0)], scrollback: Some(0), ansi: false, }); std::thread::sleep(std::time::Duration::from_millis(100)); let _ =...
rust_dataset_chunk_516202
rust_dataset.txt
516,202
512
}, _ => unreachable!(), } } } #[test] fn integration_no_scrollback_when_not_requested() { let size = Size { cols: 80, rows: 20 }; let mut mock_screen = MockScreen::new(size); mock_screen.drop_all_pty_messages(); let screen_thread = mock_screen.run(None, vec![]); ...
rust_dataset_chunk_516203
rust_dataset.txt
516,203
512
Scrollback should be None when not requested. Got: {:?}", scrollback ); }, _ => {}, } } } #[test] fn integration_subscriber_survives_after_regular_client_detach() { let size = Size { cols: 80, rows: 20 }; let mut mock_screen = MockScreen::...
rust_dataset_chunk_516204
rust_dataset.txt
516,204
512
_after_detach, "Subscriber should receive updates after regular client detach. Messages: {:?}", subscriber_msgs ); } // ========================================== // Category 3: MockScreen end-to-end CLI tests // ========================================== #[test] pub fn send_cli_scroll_up_with_pan...
rust_dataset_chunk_516205
rust_dataset.txt
516,205
512
mock_screen.teardown(vec![server_thread, screen_thread]); assert!( true, "ScrollDown with pane_id CLI action completed without errors" ); } #[test] pub fn send_cli_scroll_to_top_with_pane_id() { let size = Size { cols: 121, rows: 20, }; let client_id = 10; let m...
rust_dataset_chunk_516206
rust_dataset.txt
516,206
512
_thread, screen_thread]); assert!( true, "ScrollToBottom with pane_id CLI action completed without errors" ); } #[test] pub fn send_cli_page_scroll_up_with_pane_id() { let size = Size { cols: 121, rows: 20, }; let client_id = 10; let mut mock_screen = MockScreen:...
rust_dataset_chunk_516207
rust_dataset.txt
516,207
512
assert!( true, "PageScrollDown with pane_id CLI action completed without errors" ); } #[test] pub fn send_cli_half_page_scroll_up_with_pane_id() { let size = Size { cols: 121, rows: 20, }; let client_id = 10; let mut mock_screen = MockScreen::new(size); let sess...
rust_dataset_chunk_516208
rust_dataset.txt
516,208
512
!( true, "HalfPageScrollDown with pane_id CLI action completed without errors" ); } #[test] pub fn send_cli_resize_with_pane_id() { let size = Size { cols: 121, rows: 20, }; let client_id = 10; let mut mock_screen = MockScreen::new(size); let session_metadata = m...
rust_dataset_chunk_516209
rust_dataset.txt
516,209
512
ardown(vec![server_thread, screen_thread]); assert!( true, "MovePane with pane_id CLI action completed without errors" ); } #[test] pub fn send_cli_move_pane_backwards_with_pane_id() { let size = Size { cols: 121, rows: 20, }; let client_id = 10; let mut mock_scr...
rust_dataset_chunk_516210
rust_dataset.txt
516,210
512
_thread]); assert!( true, "Clear with pane_id CLI action completed without errors" ); } #[test] pub fn send_cli_edit_scrollback_with_pane_id() { let size = Size { cols: 121, rows: 20, }; let client_id = 10; let mut mock_screen = MockScreen::new(size); let ses...
rust_dataset_chunk_516211
rust_dataset.txt
516,211
512
assert!( true, "ToggleFullscreen with pane_id CLI action completed without errors" ); } #[test] pub fn send_cli_toggle_pane_embed_or_floating_with_pane_id() { let size = Size { cols: 121, rows: 20, }; let client_id = 10; let mut mock_screen = MockScreen::new(size); ...
rust_dataset_chunk_516212
rust_dataset.txt
516,212
512
send_cli_action_to_server(&session_metadata, cli_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![server_thread, screen_thread]); assert!( true, "ClosePane with pane_id CLI action completed without errors" ); } #[test] pub fn s...
rust_dataset_chunk_516213
rust_dataset.txt
516,213
512
()), }; send_cli_action_to_server(&session_metadata, cli_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![server_thread, screen_thread]); assert!( true, "UndoRenamePane with pane_id CLI action completed without errors" ); } ...
rust_dataset_chunk_516214
rust_dataset.txt
516,214
512
::time::Duration::from_millis(100)); let cli_action = CliAction::CloseTab { tab_id: Some(1) }; send_cli_action_to_server(&session_metadata, cli_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![server_thread, screen_thread]); assert!( tr...
rust_dataset_chunk_516215
rust_dataset.txt
516,215
512
KillSession, server_receiver ); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen.new_tab(TiledPaneLayout::default()); std::thread::sleep(std::time::Duration::from_millis(100)); let cli_action = CliAction::UndoRenameTab { tab_id: Some(0) }; send_cli_action_to_server(...
rust_dataset_chunk_516216
rust_dataset.txt
516,216
512
_actions_in_thread!( received_server_instructions, ServerInstruction::KillSession, server_receiver ); std::thread::sleep(std::time::Duration::from_millis(100)); let cli_action = CliAction::ToggleFloatingPanes { tab_id: Some(0) }; send_cli_action_to_server(&session_metadata, cli_a...
rust_dataset_chunk_516217
rust_dataset.txt
516,217
512
); std::thread::sleep(std::time::Duration::from_millis(100)); let cli_action = CliAction::NextSwapLayout { tab_id: Some(0) }; send_cli_action_to_server(&session_metadata, cli_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![server_thread, s...
rust_dataset_chunk_516218
rust_dataset.txt
516,218
512
().position; let original_pos_1 = screen.get_tab_by_id(1).unwrap().position; screen.move_tab_by_id(0, Direction::Right).expect("TEST"); assert_eq!(screen.get_tab_by_id(0).unwrap().position, original_pos_1); assert_eq!(screen.get_tab_by_id(1).unwrap().position, original_pos_0); } // ====================...
rust_dataset_chunk_516219
rust_dataset.txt
516,219
512
fn send_cli_dump_screen_action_without_ansi_strips_codes() { let size = Size { cols: 80, rows: 20 }; let client_id = 10; let mut initial_layout = TiledPaneLayout::default(); initial_layout.children_split_direction = SplitDirection::Vertical; initial_layout.children = vec![TiledPaneLayout::default()...
rust_dataset_chunk_516220
rust_dataset.txt
516,220
512
_metadata = mock_screen.clone_session_metadata(); let screen_thread = mock_screen.run(Some(initial_layout), vec![]); let received_pty_instructions = Arc::new(Mutex::new(vec![])); let pty_receiver = mock_screen.pty_receiver.take().unwrap(); let pty_thread = log_actions_in_thread!( received_pty_in...
rust_dataset_chunk_516221
rust_dataset.txt
516,221
512
(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![server_thread, screen_thread]); assert!( true, "EditScrollback with pane_id and ansi CLI action completed without errors" ); } #[test] fn subscriber_ansi_flag_preserved_in_subscription() { let size = Size { cols: 80, row...
rust_dataset_chunk_516222
rust_dataset.txt
516,222
512
_mut(&101) .unwrap() .previous_viewports .insert( zellij_utils::data::PaneId::Terminal(1), vec!["old".to_string()], ); // Build plain and ansi maps with different content let mut plain_map = HashMap::new(); plain_map.insert( zellij_utils::data...
rust_dataset_chunk_516223
rust_dataset.txt
516,223
512
log_actions_in_thread!( received_server_instructions, ServerInstruction::KillSession, server_receiver ); let plugin_receiver = mock_screen.plugin_receiver.take().unwrap(); let received_plugin_instructions = Arc::new(Mutex::new(vec![])); let plugin_thread = log_actions_in_thread!...
rust_dataset_chunk_516224
rust_dataset.txt
516,224
512
_plugins, queued before run) // Tab 1: plugin pane 3 (from new_tab_with_plugins, queued before run) // Tab 2: terminal panes only (from run, starts screen thread) // After run, client is on tab 2. Switch to tab 0 (plugin 2). // Background plugin 99 should also receive updates. let size = Size { cols...
rust_dataset_chunk_516225
rust_dataset.txt
516,225
512
plugin_ids_that_received_tab_update: Vec<u32> = vec![]; let mut plugin_ids_that_received_mode_update: Vec<u32> = vec![]; for instruction in instructions_after_switch.iter() { if let PluginInstruction::Update(updates) = instruction { for (pid, _cid, event) in updates { match ...
rust_dataset_chunk_516226
rust_dataset.txt
516,226
512
, client is on tab 2. Switch to tab 0 (plugin 2). // Only plugin 2 should receive updates; plugin 3 should not. let size = Size { cols: 80, rows: 10 }; let client_id = 10; let mut mock_screen = MockScreen::new(size); mock_screen.new_tab_with_plugins(vec![2]); mock_screen.new_tab_with_plugins(ve...
rust_dataset_chunk_516227
rust_dataset.txt
516,227
512
), "Inactive tab plugin 3 should NOT receive updates, got: {:?}", plugin_ids_that_received_updates ); } #[test] pub fn closing_tab_updates_input_modes_of_destination_tab_plugins() { let size = Size { cols: 80, rows: 10 }; let mut mock_screen = MockScreen::new(size); let client_id = moc...
rust_dataset_chunk_516228
rust_dataset.txt
516,228
512
{ // Tab 0: plugin panes 2 and 3, the client switches here and plugin 2 hides itself. // It should still hear about mode and tab changes so it can decide to show itself again. let size = Size { cols: 80, rows: 10 }; let client_id = 10; let mut mock_screen = MockScreen::new(size); mock_screen.n...
rust_dataset_chunk_516229
rust_dataset.txt
516,229
512
(Some(pid), Event::TabUpdate(..)) => tab_updates_received.push(*pid), _ => {}, } } } } assert!( mode_updates_received.contains(&2), "suppressed plugin 2 should receive a ModeUpdate, got: {:?}", mode_updates_received ); asse...
rust_dataset_chunk_516230
rust_dataset.txt
516,230
512
(Some(2), Event::TabUpdate(tab_infos)) = (pid, event) { return Some(tab_infos.clone()); } } } None }); assert!( tab_update_for_plugin_2.is_some(), "Plugin 2 should receive a TabUpdate after becoming active" ); let tab_info...
rust_dataset_chunk_516231
rust_dataset.txt
516,231
512
false, block_until_exit_success: false, block_until_exit_failure: false, no_focus: false, }; send_cli_action_to_server(&session_metadata, new_tab_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![plugin_thread, screen_thread...
rust_dataset_chunk_516232
rust_dataset.txt
516,232
512
thread::sleep(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![plugin_thread, screen_thread]); let new_tab_instruction = received_plugin_instructions .lock() .unwrap() .iter() .rev() .find(|i| { if let PluginInstruction::NewTab(..) = i { ...
rust_dataset_chunk_516233
rust_dataset.txt
516,233
512
tab_id: Some(0), border_style: None, notify: Default::default(), }; send_cli_action_to_server(&session_metadata, cli_new_pane_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen.teardown(vec![pty_thread, screen_thread]); let pty_instructions = ...
rust_dataset_chunk_516234
rust_dataset.txt
516,234
512
ane: false, no_focus: false, borderless: None, tab_id: Some(0), border_style: None, notify: Default::default(), }; send_cli_action_to_server(&session_metadata, cli_new_pane_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); mock_screen....
rust_dataset_chunk_516235
rust_dataset.txt
516,235
512
, screen_thread]); let pty_instructions = received_pty_instructions.lock().unwrap(); let pty_debug = format!("{:?}", *pty_instructions); assert!( pty_debug.contains("TabIndex(0)"), "Expected TabIndex(0) in PTY instructions for edit, got: {}", pty_debug ); } #[test] pub fn send_c...
rust_dataset_chunk_516236
rust_dataset.txt
516,236
512
(vec![pty_thread, screen_thread]); let pty_instructions = received_pty_instructions.lock().unwrap(); let pty_debug = format!("{:?}", *pty_instructions); assert!( pty_debug.contains("TabIndex(0)"), "Expected TabIndex(0) in PTY instructions with direction, got: {}", pty_debug ); } ...
rust_dataset_chunk_516237
rust_dataset.txt
516,237
512
mock_screen.teardown(vec![pty_thread, screen_thread]); let pty_instructions = received_pty_instructions.lock().unwrap(); let pty_debug = format!("{:?}", *pty_instructions); assert!( pty_debug.contains("TabIndex(0)"), "Expected TabIndex(0) in PTY instructions with stacked, got: {}", ...
rust_dataset_chunk_516238
rust_dataset.txt
516,238
512
_active_tab(client_id).unwrap(); let pane = tab.get_pane_with_id(pane_id).unwrap(); assert_eq!( pane.current_title(), "x", "Single-char CLI rename should replace, not append" ); } #[test] fn cli_rename_focused_pane_single_char_via_rename_active_pane() { // Tests that single-char...
rust_dataset_chunk_516239
rust_dataset.txt
516,239
512
let server_receiver = mock_screen.server_receiver.take().unwrap(); let server_thread = log_actions_in_thread!( received_server_instructions, ServerInstruction::KillSession, server_receiver ); // The initial layout creates pane id 0. We will use pane id 2 for the new pane // (id...
rust_dataset_chunk_516240
rust_dataset.txt
516,240
512
_filesystem.lock().unwrap(); let dumped = filesystem .values() .next() .expect("DumpScreen should have written a file"); assert!( dumped.contains("hello"), "Pane should contain the buffered output 'hello', but got: {:?}", dumped ); } // ======================...
rust_dataset_chunk_516241
rust_dataset.txt
516,241
512
Instruction::Write(bytes, terminal_id, _) = instr { out.push((bytes, terminal_id)); } } out } /// Drain every pending `ServerInstruction::KeyPassthroughChanged`, /// returning the `notify_guest` flag for each. Other variants are /// dropped. fn drain_key_...
rust_dataset_chunk_516242
rust_dataset.txt
516,242
512
web_server_ip = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)); let web_server_port = 8080; let visual_bell = true; let screen = Screen::new( bus, &client_attributes, max_panes, mode_info, draw_pane_frames, auto_layout, session_is_mirrored, copy_opti...
rust_dataset_chunk_516243
rust_dataset.txt
516,243
512
42); let query = bg_query(); let token = screen.forward_host_query(pane_id, query.clone()); assert_eq!( screen.forward_in_flight_token, Some(token), "slot must flip to in-flight for the dispatched token" ); assert_eq!( screen .pending_forwarded_queries ...
rust_dataset_chunk_516244
rust_dataset.txt
516,244
512
3333\x1b\\".to_vec(); screen .handle_forwarded_reply_from_host(token, reply.clone()) .expect("handler must not fail"); let writes = capture.drain_pty_writes(); assert_eq!(writes.len(), 1, "one pty write expected"); assert_eq!(writes[0], (reply, 7)); assert!( screen.forward_i...
rust_dataset_chunk_516245
rust_dataset.txt
516,245
512
3), clipboard_query()); assert!( capture.drain_forward_queries().is_empty(), "an opted-out clipboard read must never reach the host terminal" ); assert!(screen.clipboard_forward_in_flight_token.is_none()); assert!(screen.pending_clipboard_forwards.is_empty()); } #[test] fn clipboard_re...
rust_dataset_chunk_516246
rust_dataset.txt
516,246
512
{ let size = Size { cols: 80, rows: 20 }; let (mut screen, capture) = create_new_screen_with_forward_capture(size); screen.paste_buffer_read_enabled = true; let token = screen.forward_host_query(PaneId::Terminal(8), clipboard_query()); let _ = capture.drain_forward_queries(); let reply = b"\x1...
rust_dataset_chunk_516247
rust_dataset.txt
516,247
512
the window closed must never reach the pane" ); } #[test] fn a_second_clipboard_read_waits_for_the_first() { let size = Size { cols: 80, rows: 20 }; let (mut screen, capture) = create_new_screen_with_forward_capture(size); screen.paste_buffer_read_enabled = true; let first_token = screen.forward_h...
rust_dataset_chunk_516248
rust_dataset.txt
516,248
512
vec![false], "teardown clear must emit KeyPassthroughChanged with notify_guest=false so no FocusLost \ frame is written to the exiting guest pane" ); } #[test] fn remove_client_notifies_guest_focus_lost_on_live_ascend() { let size = Size { cols: 80, rows: 20 }; let (mut screen, capture) =...
rust_dataset_chunk_516249
rust_dataset.txt
516,249
512
.contains_key(&(client_id, pane_id)), "a full teardown (Bye/ClosePane) must discard choices, distinguishing it from suspend" ); } #[test] fn handle_reply_with_unknown_token_is_silent_noop() { // Token not in the map AND not the in-flight token: the handler // must not panic, must not w...
rust_dataset_chunk_516250
rust_dataset.txt
516,250
512
token B and // pop the next queued forward, clobbering an actively-in-flight // request. The guard makes the late timeout a no-op. let size = Size { cols: 80, rows: 20 }; let (mut screen, capture) = create_new_screen_with_forward_capture(size); let pane_a = PaneId::Terminal(1); let pane_b = Pan...
rust_dataset_chunk_516251
rust_dataset.txt
516,251
512
from a late timeout" ); } #[test] fn timeout_for_in_flight_token_releases_slot_with_cache_fallback() { // The non-racing case: server-side timeout fires while the token // is still in flight (no client reply ever arrived — the old-client // compatibility path). The handler must synthesize a cache-deri...
rust_dataset_chunk_516252
rust_dataset.txt
516,252
512
aneId::Terminal(1), bg_query()); // Clear the in-flight slot so the next call actually allocates // (the queueing branch would still allocate, but we want the // dispatch branch here). screen .handle_forwarded_reply_from_host(t1, b"r".to_vec()) .expect("ok"); let _ = capture.drain_fo...
rust_dataset_chunk_516253
rust_dataset.txt
516,253
512
Size { cols: 80, rows: 20 }; let (mut screen, capture) = create_new_screen_with_forward_capture(size); let pane = PaneId::Terminal(9); screen.update_terminal_background_color("rgb:1010/2020/3030".to_string()); let token = screen.forward_host_query(pane, bg_query()); let _ = capture.drain_forward_qu...
rust_dataset_chunk_516254
rust_dataset.txt
516,254
512
InPixels { height: 19, width: 9, }), text_area_size: Some(SizeInPixels { height: 608, width: 931, }), }, ); // CSI 14t — text-area pixels. let token = screen.forward_host_query(pane, HostQuery::TextA...
rust_dataset_chunk_516255
rust_dataset.txt
516,255
512
— the app // decides what to do with "host declined". let size = Size { cols: 80, rows: 20 }; let (mut screen, capture) = create_new_screen_with_forward_capture(size); let pane = PaneId::Terminal(1); // Default Palette::fg is EightBit(0), not Rgb — synthesis refuses. let token = screen.forward...
rust_dataset_chunk_516256
rust_dataset.txt
516,256
512
)) = self.plugin_rx.try_recv() { if let PluginInstruction::Update(updates) = instr { for (_pid, _cid, ev) in updates { out.push(ev); } } } out } fn drain_visible_events(&self) -> Vec<(Option<u32>, bool)> { let mu...
rust_dataset_chunk_516257
rust_dataset.txt
516,257
512
{ let size = Size { cols: 121, rows: 20, }; let (mut screen, capture) = create_new_screen_with_theme_capture(size); new_tab(&mut screen, 1, 0); screen .get_active_tab_mut(1) .unwrap() .new_pane( PaneId::Plugin(plugin_id), None, ...
rust_dataset_chunk_516258
rust_dataset.txt
516,258
512
1).expect("TEST"); assert!(capture.drain_visible_events().contains(&(Some(2), false))); screen.add_client(1, false).expect("TEST"); screen.sync_plugin_visibility(); assert!(capture.drain_visible_events().contains(&(Some(2), true))); } fn create_new_screen_with_theme_capture(size: Size) -> (Screen, The...
rust_dataset_chunk_516259
rust_dataset.txt
516,259
512
, size), ThemeCapture { plugin_rx, pty_writer_rx, }, ) } #[test] fn host_theme_first_update_emits_plugin_event() { let size = Size { cols: 80, rows: 20 }; let (mut screen, capture) = create_new_screen_with_theme_capture(size); screen .update_host_termina...
rust_dataset_chunk_516260
rust_dataset.txt
516,260
512
, Event::HostTerminalThemeChanged(zellij_utils::data::HostTerminalThemeMode::Light) )), "mode flip must re-emit the plugin event, got: {:?}", events ); } #[test] fn color_palette_mode_query_short_circuits_to_dark_reply() { use crate::host_query::HostQuery; let size = Siz...
rust_dataset_chunk_516261
rust_dataset.txt
516,261
512
_capture(size); assert!( screen.host_terminal_theme_mode.is_none(), "precondition: no host mode learned yet" ); screen.style.colors.text_unselected.background = zellij_utils::data::PaletteColor::Rgb((0, 0, 0)); let token = screen.forward_host_query(PaneId::Terminal(1), HostQuery...
rust_dataset_chunk_516262
rust_dataset.txt
516,262
512
Id::Terminal(9), HostQuery::ColorPaletteMode); let writes = capture.drain_pty_writes(); assert_eq!(writes.len(), 1); assert_eq!( writes[0], (b"\x1b[?997;2n".to_vec(), 9), "the host's announced mode must win over the local theme fallback" ); } #[test] fn color_palette_mode_query...
rust_dataset_chunk_516263
rust_dataset.txt
516,263
512
.host_terminal_theme_mode, Some(zellij_utils::data::HostTerminalThemeMode::Light), "an explicit hue must become the session's effective mode" ); assert_eq!( screen.style.colors.text_unselected.background, zellij_utils::data::PaletteColor::Rgb(TEST_LIGHT_BG), "Screen's own...
rust_dataset_chunk_516264
rust_dataset.txt
516,264
512
_eq!( screen.style.colors.text_unselected.background, zellij_utils::data::PaletteColor::Rgb(TEST_LIGHT_BG), ); } #[test] fn no_default_mode_without_both_themes_configured() { let size = Size { cols: 80, rows: 20 }; let (mut screen, capture) = create_new_screen_with_theme_capture(size); ...
rust_dataset_chunk_516265
rust_dataset.txt
516,265
512
_LIGHT_BG), "the palette must not be swapped while pinned" ); assert!( capture.drain_plugin_events().is_empty(), "a suppressed report is not a mode change and must not reach plugins" ); } #[test] fn manual_theme_action_pins_the_session() { let size = Size { cols: 80, rows: 20 };...
rust_dataset_chunk_516266
rust_dataset.txt
516,266
512
s_the_resolved_palette() { let size = Size { cols: 80, rows: 20 }; let (mut screen, _capture) = create_new_screen_with_dark_and_light_themes(size); screen .update_host_terminal_theme_mode(zellij_utils::data::HostTerminalThemeMode::Dark) .expect("host report applied"); screen.style.colors...
rust_dataset_chunk_516267
rust_dataset.txt
516,267
512
_light_styling = Some(new_light); screen.style.colors = styling_with_background((1, 2, 3)); screen .reapply_effective_theme_mode() .expect("mode reasserted"); assert_eq!( screen.style.colors.text_unselected.background, zellij_utils::data::PaletteColor::Rgb((250, 250, 250)),...
rust_dataset_chunk_516268
rust_dataset.txt
516,268
512
geom = PaneGeom::default(); geom.cols.set_inner(20); geom.rows.set_inner(10); TerminalPane::new( pid, geom, Style::default(), 0, String::new(), Rc::new(RefCell::new(LinkHandler::new())), Rc::new(RefCell::new(Some(SizeInPixels { width: 8, ...
rust_dataset_chunk_516269
rust_dataset.txt
516,269
512
Foreground { terminator: crate::host_query::OscTerminator::Bel, } ); let buffered = pane.drain_pending_pty_input(); assert_eq!( buffered, b"after".to_vec(), "bytes after the forward must remain queued, not rendered" ); } #[test] fn pane_no_forward_drains_que...
rust_dataset_chunk_516270
rust_dataset.txt
516,270
512
_input(); pane.handle_pty_bytes(buffered); let sync_replies = pane.drain_messages_to_pty(); assert!( !sync_replies.is_empty(), "after resume, queue is processed and Grid emits the DA1 reply" ); assert!( pane.drain_pending_pty_input().is_empty(), "queue must be fully ...
rust_dataset_chunk_516271
rust_dataset.txt
516,271
512
kicks // processing of the queued `\x1b[c`. let mut pane = new_terminal_pane_for_pause_test(1); let mut input = b"\x1b]10;?\x07".to_vec(); input.extend_from_slice(b"\x1b[c"); pane.handle_pty_bytes(input); // Forward emitted; DA1 still queued behind it. let queries = pane.drain_forwarded_qu...
rust_dataset_chunk_516272
rust_dataset.txt
516,272
512
by post-resume processing" ); } fn create_non_mirrored_screen(size: Size) -> Screen { let mut bus: Bus<ScreenInstruction> = Bus::empty(); let fake_os_input = FakeInputOutput::default(); bus.os_input = Some(Box::new(fake_os_input)); let client_attributes = ClientAttributes { size, ....
rust_dataset_chunk_516273
rust_dataset.txt
516,273
512
screen.set_client_size(1, client_size); new_tab(&mut screen, 1, 0); assert_eq!( screen.tabs.get(&0).unwrap().size, client_size, "A tab is created at the size of the client creating it" ); } #[test] fn applying_a_layout_to_an_existing_tab_keeps_its_viewer_derived_size() { l...
rust_dataset_chunk_516274
rust_dataset.txt
516,274
512
}, ); screen.set_client_size(2, Size { cols: 80, rows: 60 }); screen.recompute_tab_size(0).expect("TEST"); assert_eq!( screen.tabs.get(&0).unwrap().size, Size { cols: 80, rows: 24 }, "Tab size = (min cols across viewers, min rows across viewers)" ); } #[test] fn recompute_...
rust_dataset_chunk_516275
rust_dataset.txt
516,275
512
Size { cols: 80, rows: 24 }, "Both clients on tab 1 → it sizes to the smaller" ); screen.switch_active_tab(0, None, true, 1).expect("TEST"); assert_eq!( screen.tabs.get(&1).unwrap().size, Size { cols: 160, rows: 50, }, "Source tab gro...
rust_dataset_chunk_516276
rust_dataset.txt
516,276
512
(&mut screen, 2, 1); screen.add_client(2, false).expect("TEST"); screen.set_client_size(1, Size { cols: 80, rows: 24 }); screen.set_client_size( 2, Size { cols: 160, rows: 50, }, ); screen.switch_active_tab(0, None, true, 1).expect("TEST"); assert...
rust_dataset_chunk_516277
rust_dataset.txt
516,277
512
); screen.switch_active_tab(0, None, true, 2).expect("TEST"); assert_eq!( screen.tabs.get(&0).unwrap().size, Size { cols: 160, rows: 50, }, "Pre-condition: tab 0 sized to client 2" ); assert_eq!( screen.tabs.get(&1).unwrap().size, ...
rust_dataset_chunk_516278
rust_dataset.txt
516,278
512
assert_eq!( screen.tabs.get(&0).unwrap().size, Size { cols: 160, rows: 50, }, "Tab grows back to fit the remaining viewer after the smaller one detaches" ); } #[test] fn closing_a_tab_resizes_the_tab_it_returns_to() { let initial_size = Size { ...
rust_dataset_chunk_516279
rust_dataset.txt
516,279
512
_utils::nested_session::{ decode_base64, decode_payload, NESTED_FRAME_HEADER, NESTED_FRAME_TERMINATOR, }; let encoded_payload = bytes .strip_prefix(NESTED_FRAME_HEADER)? .strip_suffix(NESTED_FRAME_TERMINATOR)?; decode_payload(&decode_base64(encoded_payload)?) } fn guest_announce_mes...
rust_dataset_chunk_516280
rust_dataset.txt
516,280
512
], } ); assert!(received_background_jobs .lock() .unwrap() .iter() .any(|job| matches!( job, BackgroundJob::StartNestedGuestPing(PaneId::Terminal(0)) ))); } #[test] pub fn nested_guest_announce_in_never_mode_still_completes_handshake() { ...
rust_dataset_chunk_516281
rust_dataset.txt
516,281
512
.pty_writer_receiver.take().unwrap(); let received_background_jobs = mock_screen.received_background_jobs.clone(); let screen_thread = mock_screen.run(None, vec![]); let received_pty_instructions = Arc::new(Mutex::new(vec![])); let pty_writer_thread = log_actions_in_thread!( received_pty_instruc...
rust_dataset_chunk_516282
rust_dataset.txt
516,282
512
.get_active_tab_mut(1).unwrap(); let active_pane = active_tab.get_active_pane_mut(1).unwrap(); active_pane.handle_pty_bytes(b"\x1b_Ga=q,i=31,s=1,v=1,t=d,f=24;AAAA\x1b\\".to_vec()); assert_eq!( active_pane.drain_messages_to_pty(), vec![b"\x1b_Gi=31;OK\x1b\\".to_vec()] ); } #[test] fn kit...
rust_dataset_chunk_516283
rust_dataset.txt
516,283
512
_pane = active_tab.get_active_pane_mut(1).unwrap(); active_pane.handle_pty_bytes(b"\x1b_Ga=q,i=31,s=1,v=1,t=d,f=24;AAAA\x1b\\".to_vec()); assert!( active_pane.drain_messages_to_pty().is_empty(), "a disabled protocol must not reply to queries at all" ); } #[test] fn kitty_zlib_support_is_rec...
rust_dataset_chunk_516284
rust_dataset.txt
516,284
512
1, false, false); screen.update_kitty_graphics_support(2, true, false); screen.remove_client(2).expect("TEST"); let active_tab = screen.get_active_tab_mut(1).unwrap(); let active_pane = active_tab.get_active_pane_mut(1).unwrap(); active_pane.handle_pty_bytes(b"\x1b_Ga=q,i=31,s=1,v=1,t=d,f=24;AAAA\x1...
rust_dataset_chunk_516285
rust_dataset.txt
516,285
512
}; let mut screen = create_new_screen(size, true, true); new_tab(&mut screen, 1, 0); screen.add_client(2, true).expect("TEST"); assert_eq!(screen.kitty_local_media.borrow().get(&2), Some(&false)); } #[test] fn an_undeclared_web_client_is_refused_kitty_and_sixel() { let size = Size { cols: ...
rust_dataset_chunk_516286
rust_dataset.txt
516,286
512
assert_eq!( screen.kitty_host_capabilities.borrow().get(&2), Some(&KittyHostCapability { graphics: true, zlib: false, }) ); assert_eq!(screen.kitty_local_media.borrow().get(&2), Some(&false)); assert_eq!(screen.sixel_host_capabilities.borrow().get(&2), Some(&...
rust_dataset_chunk_516287
rust_dataset.txt
516,287
512
, false); assert_eq!( screen.sixel_host_capabilities.borrow().get(&1), Some(&false) ); let active_tab = screen.get_active_tab_mut(1).unwrap(); let active_pane = active_tab.get_active_pane_mut(1).unwrap(); active_pane.handle_pty_bytes(b"\x1b[c".to_vec()); assert_eq!( activ...
rust_dataset_chunk_516288
rust_dataset.txt
516,288
512
test] fn fit_disabled_ignores_client_on_another_tab() { let initial_size = Size { cols: 200, rows: 60, }; let mut screen = create_non_mirrored_screen(initial_size); new_tab(&mut screen, 1, 0); new_tab(&mut screen, 2, 1); screen .add_client(2, /* is_web_client */ false) ...
rust_dataset_chunk_516289
rust_dataset.txt
516,289
512
pinned to the initial desktop reference size" ); // Desktop client resizes; the fit-disabled tab must re-pin to its new size. screen.set_client_size( 2, Size { cols: 120, rows: 40, }, ); screen.recompute_fit_disabled_tabs().expect("TEST"); asser...
rust_dataset_chunk_516290
rust_dataset.txt
516,290
512
else is viewing it" ); } #[test] fn fit_disabled_allowed_when_only_other_client_is_web() { let initial_size = Size { cols: 80, rows: 20 }; let mut screen = create_new_screen(initial_size, true, true); new_tab(&mut screen, 1, 0); screen .add_client(1, /* is_web_client */ true) .expe...
rust_dataset_chunk_516291
rust_dataset.txt
516,291
512
80, rows: 20 }); screen.set_client_size(2, Size { cols: 40, rows: 10 }); screen .set_mobile_render_preferences(2, /* single_pane */ false, /* fit */ false) .expect("TEST"); assert_eq!( screen.tabs.get(&0).unwrap().size, Size { cols: 80, rows: 20 }, "Pre-condition: f...
rust_dataset_chunk_516292
rust_dataset.txt
516,292
512
1).expect("TEST"); screen.switch_active_tab(1, None, true, 2).expect("TEST"); assert_eq!( screen.get_active_pane_id(&2), Some(PaneId::Terminal(2)), "Pre-condition: client 2 is focused on pane 2 (its own tab)" ); // Client 1 focuses the pane living on client 2's tab. screen...
rust_dataset_chunk_516293
rust_dataset.txt
516,293
512
never sent preferences" ); } #[test] fn single_pane_demotes_after_desktop_unfullscreen() { let initial_size = Size { cols: 80, rows: 20 }; let mut screen = create_new_screen(initial_size, true, true); new_tab(&mut screen, 1, 0); add_second_pane_to_active_tab(&mut screen, 2); let client = 1; ...
rust_dataset_chunk_516294
rust_dataset.txt
516,294
512
); screen.switch_active_tab(0, None, true, 1).expect("TEST"); screen.switch_active_tab(0, None, true, 2).expect("TEST"); screen .set_mobile_render_preferences(1, /* single_pane */ true, /* fit */ true) .expect("TEST"); // Simulate a desktop-initiated un-fullscreen on the shared tab...
rust_dataset_chunk_516295
rust_dataset.txt
516,295
512
().expect("TEST"); assert!( !screen.tabs.get(&0).unwrap().is_fullscreen_active(), "The pane the desktop client opened stays visible" ); assert_eq!( screen .mobile_web_prefs .get(&mobile_client) .map(|prefs| prefs.single_pane), Some(false),...
rust_dataset_chunk_516296
rust_dataset.txt
516,296
512
).unwrap().fullscreen_pane_id().unwrap(); // A desktop client toggles regular fullscreen, downgrading the no-ui fullscreen. screen .tabs .get_mut(&0) .unwrap() .toggle_pane_fullscreen(fullscreen_pane_id); screen.log_and_report_session_state().expect("TEST"); assert!( ...
rust_dataset_chunk_516297
rust_dataset.txt
516,297
512
.mobile_web_prefs .get(&mobile_client) .map(|prefs| prefs.single_pane), Some(true), "A pane the mobile client opened itself does not demote it out of single-pane mode" ); assert_eq!( screen.tabs.get(&0).unwrap().fullscreen_pane_id(), Some(PaneI...
rust_dataset_chunk_516298
rust_dataset.txt
516,298
512
fullscreened for the mobile client" ); assert!( screen.tabs.get(&1).unwrap().fullscreen_covers_ui(), "The new tab's fullscreen still hides the tab bar and status bar" ); } #[test] fn attaching_web_client_lands_on_the_first_tab() { let size = Size { cols: 121, rows: 20, ...
rust_dataset_chunk_516299
rust_dataset.txt
516,299
512
(PaneId::Terminal(3), None, None, false, true, None, None) .unwrap(); screen.add_client(2, true).expect("TEST"); assert!( screen.tabs.get(&1).unwrap().are_floating_panes_visible(), "the floating surface of the host tab is untouched" ); assert_eq!( screen.get_active_pane...