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_514500
rust_dataset.txt
514,500
512
let actions = key_dispatch( &keybinds(), &InputMode::Normal, InputMode::Normal, &ctrl('g'), vec![], false, true, false, false, ); assert_eq!(actions, vec![write(ctrl('g'))]); } #[...
rust_dataset_chunk_514501
rust_dataset.txt
514,501
512
(Action::TabNameInput { input: vec![0] }, Ignore), (Action::SessionNameInput { input: vec![0] }, Ignore), (Action::UndoRenameSession, Ignore), ( Action::SkipConfirm { action: Box::new(Action::CloseFocus), }, ClosePo...
rust_dataset_chunk_514502
rust_dataset.txt
514,502
512
: &str, wait_forever: bool, ) -> ActionCompletionResult { let runtime = get_tokio_runtime(); if wait_forever { runtime.block_on(async { match receiver.await { Ok(result) => result, Err(e) => { log::error!("Failed to wait for action {}: ...
rust_dataset_chunk_514503
rust_dataset.txt
514,503
512
eshot channel to the receiver, letting // it know the action is ended and thus releasing it // // Note: Cloning this struct DOES NOT clone that internal receiver, it only implements Clone so // that it can be included in various other larger structs - DO NOT RELY ON CLONING IT! #[derive(Debug)] pub struct NotificationE...
rust_dataset_chunk_514504
rust_dataset.txt
514,504
512
.affected_pane_id = None; } pub fn set_affected_tab_id(&mut self, tab_id: usize) { self.affected_tab_id = Some(tab_id); } pub fn set_error_message(&mut self, message: String) { self.error_message = Some(message); } pub fn set_stdout_message(&mut self, message: String) { ...
rust_dataset_chunk_514505
rust_dataset.txt
514,505
512
InBackground { .. } => true, _ => false, } } fn is_attributed_to_ephemeral_cli_client( client_id: ClientId, cli_client_id: Option<ClientId>, is_cli_client: bool, ) -> bool { is_cli_client && cli_client_id == Some(client_id) } fn action_presses_escape(action: &Action) -> bool { match ac...
rust_dataset_chunk_514506
rust_dataset.txt
514,506
512
Option<&mut HashSet<String>>, default_mode: InputMode, os_input: Option<Box<dyn ServerOsApi>>, is_cli_client: bool, ) -> Result<(bool, Option<ActionCompletionResult>)> { route_action_with_origin( action, client_id, cli_client_id, pane_id, senders, default...
rust_dataset_chunk_514507
rust_dataset.txt
514,507
512
Update(vec![( None, Some(client_id), Event::InputReceived, )])) .with_context(err_context)?; } if crate::session_suggestions::should_report_activity() { let _ = senders.send_to_background_jobs(Backgro...
rust_dataset_chunk_514508
rust_dataset.txt
514,508
512
pane_id } => { senders .send_to_screen(ScreenInstruction::ClearScroll(client_id)) .with_context(err_context)?; senders .send_to_screen(ScreenInstruction::WriteToPaneId( bytes, pane_id.into(), ...
rust_dataset_chunk_514509
rust_dataset.txt
514,509
512
::FocusNextPane( client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::FocusPreviousPane => { senders .send_to_screen(ScreenInstruction::FocusPreviousPane( ...
rust_dataset_chunk_514510
rust_dataset.txt
514,510
512
(client_id, notification_end) }, Some(Direction::Right) => { ScreenInstruction::MovePaneRight(client_id, notification_end) }, Some(Direction::Up) => ScreenInstruction::MovePaneUp(client_id, notification_end), Some(Direct...
rust_dataset_chunk_514511
rust_dataset.txt
514,511
512
_context(err_context)?; }, Action::ScrollUp => { senders .send_to_screen(ScreenInstruction::ScrollUp( client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, ...
rust_dataset_chunk_514512
rust_dataset.txt
514,512
512
senders .send_to_screen(ScreenInstruction::PageScrollUp( client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::PageScrollDown => { senders ...
rust_dataset_chunk_514513
rust_dataset.txt
514,513
512
senders .send_to_screen(ScreenInstruction::ToggleBars( bars, client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::HideBars { bars } => { ...
rust_dataset_chunk_514514
rust_dataset.txt
514,514
512
explicitly over the one that originated // it (this might be a bit misleading with "near_current_pane", but it's still the // right behavior - in the latter case, if the originator does not wish for this // behavior, they should not provide pane // inside the placement, ...
rust_dataset_chunk_514515
rust_dataset.txt
514,515
512
if should_float { NewPanePlacement::Floating(floating_pane_coordinates) } else { NewPanePlacement::Tiled { direction: split_direction, borderless: floating_pane_coordinates ...
rust_dataset_chunk_514516
rust_dataset.txt
514,516
512
map(|cmd| TerminalAction::RunCommand(cmd.into())) .or_else(|| default_shell.clone()); let explicit_pane_id_to_replace: Option<PaneId> = pane_id_to_replace .and_then(|pane_id_to_replace| pane_id_to_replace.try_into().ok()); let pane_id = explicit_pane_id_to_replace...
rust_dataset_chunk_514517
rust_dataset.txt
514,517
512
_style: None, }, ClientTabIndexOrPaneId::PaneId(pane_id), ) } else { ( NewPanePlacement::Stacked { pane_id_to_stack_under: None, borderless: None, ...
rust_dataset_chunk_514518
rust_dataset.txt
514,518
512
, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::UndoRenamePane => { senders .send_to_screen(ScreenInstruction::UndoRenamePane( client_id, Some(N...
rust_dataset_chunk_514519
rust_dataset.txt
514,519
512
tiled_layout: tab_layout, floating_layouts: floating_panes_layout, swap_tiled_layouts, swap_floating_layouts, tab_name, should_change_focus_to_new_tab, cwd, initial_panes, first_pane_unblock_condition, } => { ...
rust_dataset_chunk_514520
rust_dataset.txt
514,520
512
Action::GoToTabName { name, create } => { let shell = default_shell.clone(); senders .send_to_screen(ScreenInstruction::GoToTabName( name, shell, create, Some(client_id), Some(Not...
rust_dataset_chunk_514521
rust_dataset.txt
514,521
512
RenameTabWithId( id as usize, name.into_bytes(), Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::MoveTab { direction } => { let screen_instr = match direction { ...
rust_dataset_chunk_514522
rust_dataset.txt
514,522
512
with_context(err_context)?; }, Action::MutePane => { senders .send_to_screen(ScreenInstruction::MutePane( None, client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(e...
rust_dataset_chunk_514523
rust_dataset.txt
514,523
512
::GoToNextSession => { let history_move = match action { Action::ToggleSession => zellij_utils::session_history::HistoryMove::Toggle, Action::GoToPreviousSession => zellij_utils::session_history::HistoryMove::Back, _ => zellij_utils::session_history::HistoryMo...
rust_dataset_chunk_514524
rust_dataset.txt
514,524
512
.send_to_screen(ScreenInstruction::GoToNextAttention( client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::MarkPaneSeen { session, pane_id } => { senders ...
rust_dataset_chunk_514525
rust_dataset.txt
514,525
512
(completion_tx)), ) }; senders .send_to_server(instruction) .with_context(err_context)?; should_break = true; } else { drop(completion_tx); // no need to wait, this is a no-op ...
rust_dataset_chunk_514526
rust_dataset.txt
514,526
512
_id, notification_end) }, SearchOption::Wrap => { ScreenInstruction::SearchToggleWrap(client_id, notification_end) }, }; senders .send_to_screen(instruction) .with_context(err_context)?; }...
rust_dataset_chunk_514527
rust_dataset.txt
514,527
512
pane_name: name, skip_cache, cwd, no_focus, tab_id, } => { senders .send_to_screen(ScreenInstruction::NewTiledPluginPane( run_plugin, name, skip_cache, ...
rust_dataset_chunk_514528
rust_dataset.txt
514,528
512
pane_id, skip_cache, client_id, Some(NotificationEnd::new(completion_tx)), tab_id, )) .with_context(err_context)?; }, Action::LaunchPlugin { plugin: run_plugin, should...
rust_dataset_chunk_514529
rust_dataset.txt
514,529
512
pane_id), should_float_if_hidden, should_be_in_place_if_hidden, client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::RenameTerminalPane { ...
rust_dataset_chunk_514530
rust_dataset.txt
514,530
512
Fullscreen( client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::RenameSession { name } => { senders .send_to_screen(ScreenInstruction::RenameSession( ...
rust_dataset_chunk_514531
rust_dataset.txt
514,531
512
payload, plugin, args, mut configuration, floating, in_place, skip_cache, cwd, pane_title, launch_new, plugin_id, .. } => { if let Some(name) = name.take() { ...
rust_dataset_chunk_514532
rust_dataset.txt
514,532
512
format_panes_as_json(&pane_entries) } else { format_panes_table( &pane_entries, show_tab || show_all, show_command || show_all, show_state || show_all, show_geomet...
rust_dataset_chunk_514533
rust_dataset.txt
514,533
512
.send_to_screen(ScreenInstruction::ToggleMirrorResize( client_id, Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::StackPanes { pane_ids: pane_ids_to_stack, } ...
rust_dataset_chunk_514534
rust_dataset.txt
514,534
512
Some(NotificationEnd::new(completion_tx)), }) .with_context(err_context)?; }, Action::HideFloatingPanes { tab_id } => { senders .send_to_screen(ScreenInstruction::HideFloatingPanes { client_id, tab_id, ...
rust_dataset_chunk_514535
rust_dataset.txt
514,535
512
_id } => { senders .send_to_screen(ScreenInstruction::HalfPageScrollUpWithPaneId( pane_id.into(), Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::HalfPageScrollDownBy...
rust_dataset_chunk_514536
rust_dataset.txt
514,536
512
=> { senders .send_to_screen(ScreenInstruction::ToggleNoUiFullscreenWithPaneId( pane_id.into(), Some(NotificationEnd::new(completion_tx)), )) .with_context(err_context)?; }, Action::TogglePaneEmbedOrFloa...
rust_dataset_chunk_514537
rust_dataset.txt
514,537
512
::new(completion_tx)), )) .with_context(err_context)?; }, Action::ToggleFloatingPanesByTabId { id } => { senders .send_to_screen(ScreenInstruction::ToggleFloatingPanesWithTabId( id as usize, default_shell...
rust_dataset_chunk_514538
rust_dataset.txt
514,538
512
)) .with_context(err_context)?; }, Action::StartRenamePaneByPaneId { pane_id } => { senders .send_to_screen(ScreenInstruction::StartRenamePaneWithPaneId( pane_id.into(), client_id, )) ...
rust_dataset_chunk_514539
rust_dataset.txt
514,539
512
.to_string()], }, ); } } } // Return pane ID to CLI clients as plain text if let Some(pane_id) = result.affected_pane_id { if let Some(cli_client_id) = cli_client_id { if let Some(ref os_input) = os_input { let _ = o...
rust_dataset_chunk_514540
rust_dataset.txt
514,540
512
_data: Arc<RwLock<Option<SessionMetaData>>>, session_state: Arc<RwLock<SessionState>>, os_input: Box<dyn ServerOsApi>, to_server: SenderWithContext<ServerInstruction>, mut receiver: IpcReceiverWithContext<ClientToServerMsg>, client_id: ClientId, first_instruction: Option<ClientToServerMsg>, ) ->...
rust_dataset_chunk_514541
rust_dataset.txt
514,541
512
}); should_break = true; } }, ClientToServerMsg::TerminalResize { new_size } => { // For watchers: send size to Screen for rendering adjustments, but ...
rust_dataset_chunk_514542
rust_dataset.txt
514,542
512
s| { let in_key_passthrough = s.key_passthrough_clients.contains_key(&client_id); let live_view_capture = s .live_view_captures ...
rust_dataset_chunk_514543
rust_dataset.txt
514,543
512
(completion_tx, completion_rx) = oneshot::channel(); let _ = senders.send_to_screen( ScreenInstruction::KeyToPopup( popup_key, ...
rust_dataset_chunk_514544
rust_dataset.txt
514,544
512
senders.send_to_plugin(PluginInstruction::UserInput { client_id, action: action.clone(), terminal_id: maybe_pane_id, cli_client_id: if is_cli_client { ...
rust_dataset_chunk_514545
rust_dataset.txt
514,545
512
TerminalResize(client_id, new_size), instruction, retry_queue ) .with_context(err_context)?; } else { session_state ...
rust_dataset_chunk_514546
rust_dataset.txt
514,546
512
supported, ref shortcut, } => { send_to_screen_or_retry_queue!( senders, ScreenInstruction::SetClipboardPasteSupport { client_id, ...
rust_dataset_chunk_514547
rust_dataset.txt
514,547
512
is_web_client, } => { wait_for_session_to_be_ready(&session_data); let allow_web_connections = session_data .read() .ok() ...
rust_dataset_chunk_514548
rust_dataset.txt
514,548
512
(ServerInstruction::ConnStatus(client_id)); should_break = true; }, ClientToServerMsg::DetachSession { client_ids } if client_ids.is_empty() => { let _ = to_server.send(ServerInstruction::DisconnectAllClientsExcept( ...
rust_dataset_chunk_514549
rust_dataset.txt
514,549
512
_ids: pane_ids.clone(), scrollback: *scrollback, ansi, }, instruction, retry_queue ); }, ...
rust_dataset_chunk_514550
rust_dataset.txt
514,550
512
::nested_session::NestedSessionMessage::FullscreenState { .. }) => { let _ = send_to_screen_or_retry_queue!( senders, ScreenInstruction::NestedSessionMessageFromHost { client_id, message }, ...
rust_dataset_chunk_514551
rust_dataset.txt
514,551
512
_ = senders.send_to_screen( ScreenInstruction::UpdateSessionInfos( live_sessions_map, resurrectable_sessions_map, None, ...
rust_dataset_chunk_514552
rust_dataset.txt
514,552
512
.is_empty() { deferred_instructions.push_back(pending_instruction); continue; } if index < retried_count { log::warn!("Server ready, retrying sending instruction."); ...
rust_dataset_chunk_514553
rust_dataset.txt
514,553
512
show_all, response_channel: response_sender, })?; match response_receiver.recv_timeout(Duration::from_secs(1)) { Ok(entries) => Ok(Some(entries)), Err(RecvTimeoutError::Timeout) => { log::error!("ListPanes timed out waiting for Screen response"); Ok(None)...
rust_dataset_chunk_514554
rust_dataset.txt
514,554
512
_info.is_plugin { let pane_id = PaneId::Terminal(entry.pane_info.id); enrich_pane_with_running_command(entry, pane_id, senders)?; enrich_pane_with_cwd(entry, pane_id, senders)?; } } Ok(()) } fn enrich_pane_with_running_command( entry: &mut PaneListEntry, pane...
rust_dataset_chunk_514555
rust_dataset.txt
514,555
512
entries { lines.push(build_table_row( entry, show_tab, show_command, show_state, show_geometry, )); } lines } fn build_table_header( show_tab: bool, show_command: bool, show_state: bool, show_geometry: bool, ) -> Stri...
rust_dataset_chunk_514556
rust_dataset.txt
514,556
512
format!("terminal_{}", pane_info.id) } } fn format_pane_type(pane_info: &zellij_utils::data::PaneInfo) -> String { if pane_info.is_plugin { "plugin".to_string() } else { "terminal".to_string() } } fn extract_command(entry: &PaneListEntry) -> String { entry .pane_command ...
rust_dataset_chunk_514557
rust_dataset.txt
514,557
512
.push("FLOAT_PANES"); header.push("HIDDEN_PANES"); } if show_layout { header.push("SWAP_LAYOUT"); header.push("LAYOUT_DIRTY"); } header.join(" ") } fn build_tabs_table_row( tab_info: &TabInfo, show_state: bool, show_dimensions: bool, show_panes: bool, show...
rust_dataset_chunk_514558
rust_dataset.txt
514,558
512
_input.send_to_client( cli_client_id, ServerToClientMsg::LogError { lines: vec![error_message.to_string()], }, ); } } } fn send_output_to_client( cli_client_id: Option<ClientId>, os_input: Option<&Box<dyn ServerOsApi>>,...
rust_dataset_chunk_514559
rust_dataset.txt
514,559
512
bytes: vec![0x1b], is_kitty_keyboard_protocol: false, })); } #[test] fn escape_sequences_and_modified_escapes_are_not_a_bare_escape() { assert!(!action_presses_escape(&write_key( BareKey::Esc, &[KeyModifier::Alt], vec![0x1b, 0x1b] ...
rust_dataset_chunk_514560
rust_dataset.txt
514,560
512
#[test] fn cli_actions_falling_back_to_the_cli_client_id_are_ephemeral() { assert!(is_attributed_to_ephemeral_cli_client(7, Some(7), true)); } #[test] fn cli_actions_attributed_to_an_attached_client_are_not_ephemeral() { assert!(!is_attributed_to_ephemeral_cli_client(1, Some(7), tru...
rust_dataset_chunk_514561
rust_dataset.txt
514,561
512
#[test] fn test_notification_end_clone_does_not_copy_channel() { let (tx, _rx) = oneshot::channel(); let mut notification_end = NotificationEnd::new(tx); notification_end.set_affected_tab_id(99); let cloned = notification_end.clone(); // Verify the clone has the same da...
rust_dataset_chunk_514562
rust_dataset.txt
514,562
512
_pane_with_id_mut(pane_id) { if let Some(mut refused) = waiter.take().and_then(|w| pane.attach_exit_waiter(w)) { refused.set_error_message(format!( "Something else is already waiting for pane {:?}", pane_id )); ...
rust_dataset_chunk_514563
rust_dataset.txt
514,563
512
_id) { visible.extend( tab.kitty_visible_pane_ids() .into_iter() .map(Into::<zellij_utils::data::PaneId>::into), ); if let Some(active) = tab.get_active_pane_id(*client_id) { focused.i...
rust_dataset_chunk_514564
rust_dataset.txt
514,564
512
mut self) { let typed: Vec<PaneId> = self .tabs .values_mut() .flat_map(|tab| tab.take_typed_into()) .collect(); if typed.is_empty() { return; } let now = now_ms(); for pane_id in typed { self.attention.on_us...
rust_dataset_chunk_514565
rust_dataset.txt
514,565
512
_checks() { let _ = self .bus .senders .send_to_background_jobs(BackgroundJob::AttentionIdleCheck( pane_id.into(), delay_ms, )); } let changed: Vec<zellij_utils::data::PaneId> = ...
rust_dataset_chunk_514566
rust_dataset.txt
514,566
512
{ let title = tab .get_pane_with_id(pane_id.into()) .map(|p| p.current_title()) .unwrap_or_default(); (pane_id, title) }) .collect(); ...
rust_dataset_chunk_514567
rust_dataset.txt
514,567
512
(), self.session_attention())); GlobalAttention::build(&own, sessions) } pub(crate) fn set_client_session_history( &mut self, client_id: ClientId, history: SessionHistory, arrival: Option<SessionArrival>, arrived_from: Option<String>, ) { self.client_...
rust_dataset_chunk_514568
rust_dataset.txt
514,568
512
} } pub(crate) fn go_to_session_pane( &mut self, client_id: ClientId, session: &str, pane_id: zellij_utils::data::PaneId, ) -> bool { if self.is_this_session(Some(session)) { return self .focus_pane_with_id(pane_id.into(), true, fa...
rust_dataset_chunk_514569
rust_dataset.txt
514,569
512
(pane_id)) = (session, pane_id) else { return false; }; self.remote_actions.send( &session, vec![Action::MarkPaneSeen { session: Some(session.clone()), pane_id: Some(pane_id), }], ); true } pub(crate...
rust_dataset_chunk_514570
rust_dataset.txt
514,570
512
ClientId, ) -> bool { if self.is_this_session(session_name.as_deref()) { let handled = match command { SessionPaneCommand::MarkSeen(pane_id) => { self.mark_pane_seen(None, Some(pane_id), client_id) }, SessionPaneCommand::Write(...
rust_dataset_chunk_514571
rust_dataset.txt
514,571
512
{ return self.go_to_session_pane(client_id, &session_name, pane_id); }, }; self.remote_actions.send(&session_name, vec![action]); true } pub(super) fn resolve_session_history_context_menu_entries( &self, entries: Vec<ContextMenuEntry>, ...
rust_dataset_chunk_514572
rust_dataset.txt
514,572
512
self.flush_attention(true); true } pub(super) fn toggle_pane_ignore_output( &mut self, pane_id: Option<zellij_utils::data::PaneId>, client_id: ClientId, ) -> bool { let Some(pane_id) = self.attention_target_pane(pane_id, client_id) else { return f...
rust_dataset_chunk_514573
rust_dataset.txt
514,573
512
self, pane_id: zellij_utils::data::PaneId) { self.attention.idle_check(pane_id, now_ms()); self.flush_attention(true); } pub(super) fn attention_foreground_changed( &mut self, pane_id: zellij_utils::data::PaneId, command: Option<String>, ) { if !self.attenti...
rust_dataset_chunk_514574
rust_dataset.txt
514,574
512
fn context_menu_toggle_is_on( &self, actions: &[ContextMenuAction], context: &ContextMenuContext, ) -> bool { let clicked_pane = context .target_pane_id() .filter(|p| matches!(p, PaneIdUtils::Terminal(_))); let clicked_tab = context.tab_id; le...
rust_dataset_chunk_514575
rust_dataset.txt
514,575
512
(|p| self.attention.pane_is_muted(&p)) .unwrap_or(false), ContextMenuAction::Action(Action::MutePaneByPaneId { pane_id }) => { self.attention.pane_is_muted(pane_id) }, ContextMenuAction::Action(Action::IgnorePaneOutput) => focused_pane ...
rust_dataset_chunk_514576
rust_dataset.txt
514,576
512
{ ContextMenuEntry::Item { label, actions, toggled_label: Some(toggled_label), } => { let label = if self.context_menu_toggle_is_on(&actions, context) { toggled_label ...
rust_dataset_chunk_514577
rust_dataset.txt
514,577
512
Item { AttentionItem { pane_id: PaneIdUtils::Terminal(1), tab_id: 0, tab_name: "api".to_owned(), pane_title: "claude".to_owned(), attention: PaneAttention { status, source: Some(source), text: text.to_own...
rust_dataset_chunk_514578
rust_dataset.txt
514,578
512
super::Screen; use crate::ClientId; use std::collections::{BTreeMap, HashMap}; use zellij_utils::data::{PaneId, PaneInfo, PaneManifest}; use zellij_utils::ipc::{ExitReason, ServerToClientMsg}; use zellij_utils::session_events::{ input_mode_name, CliClientState, CliEvent, CliEventFilter, CliPaneState, CliTabState, ...
rust_dataset_chunk_514579
rust_dataset.txt
514,579
512
: &dyn Fn(usize) -> bool) -> HashMap<usize, usize> { let mut ordered: Vec<&CliTabState> = tabs.iter().filter(|t| common(t.tab_id)).collect(); ordered.sort_by_key(|t| t.position); ordered .iter() .enumerate() .map(|(rank, t)| (t.tab_id, rank)) .collect() } pub(crate) fn diff_...
rust_dataset_chunk_514580
rust_dataset.txt
514,580
512
if previous.title != pane.title { events.push(CliEvent::PaneRenamed { pane_id: pane.pane_id, tab_id: pane.tab_id, title: pane.title.clone(), previous_title: previous.title.clone(), })...
rust_dataset_chunk_514581
rust_dataset.txt
514,581
512
previous_position: previous.position, }); } } } for client in &next.clients { let previous = prev_clients.get(&client.client_id); if previous.is_none() { events.push(CliEvent::ClientAttached { client_id: client.client_id, ...
rust_dataset_chunk_514582
rust_dataset.txt
514,582
512
)> = vec![]; for tab in self.tabs.values() { let pane_infos = match pane_manifest { Some(pane_manifest) => pane_manifest .panes .get(&tab.position) .cloned() .unwrap_or_default(), None => ...
rust_dataset_chunk_514583
rust_dataset.txt
514,583
512
self.session_snapshot(Some(pane_manifest)); let events = match &self.event_subscribers.previous { Some(previous) if *previous == snapshot => return, Some(previous) => diff_snapshots(previous, &snapshot), None => vec![], }; self.event_subscribers.previous = So...
rust_dataset_chunk_514584
rust_dataset.txt
514,584
512
find_tab = |pane_id: &PaneId| { self.event_subscribers.previous.as_ref().and_then(|s| { s.panes .iter() .find(|p| p.pane_id == *pane_id) .map(|p| p.tab_id) }) }; match event { CliEvent::PaneC...
rust_dataset_chunk_514585
rust_dataset.txt
514,585
512
Id; use crate::plugins::{PluginInstruction, PromptCaller, SERVER_NOTICE_CALLER_ID}; use crate::tab::{PopupBehavior, PopupPlacement}; use crate::ClientId; use std::collections::BTreeMap; use zellij_utils::attention::sanitize_display_text; use zellij_utils::data::{ bar_role_label, ClickedPaneAction, ContextMenuAction...
rust_dataset_chunk_514586
rust_dataset.txt
514,586
512
} pub fn hide_bars(&mut self, bars: &[String], _client_id: ClientId) { let requested = HiddenBars::all_unless_named(bars); let hidden_bars = self.hidden_bars.union(&requested); if hidden_bars == self.hidden_bars { return; } self.set_hidden_bars(hidden_bars); ...
rust_dataset_chunk_514587
rust_dataset.txt
514,587
512
(|(tab_id, _)| *tab_id); if let Some(tab_id) = tab_id { self.apply_hidden_bars_to_tab(tab_id); } } pub fn update_mode_hints_for_all_clients(&mut self) { let client_ids: Vec<ClientId> = self.active_tab_ids.keys().copied().collect(); for client_id in client_ids { ...
rust_dataset_chunk_514588
rust_dataset.txt
514,588
512
} } } fn request_mode_hints_popup(&mut self, client_id: ClientId) { let configuration = BTreeMap::from([("role".to_owned(), MODE_HINTS_ROLE.to_owned())]); let run_plugin_or_alias = match RunPluginOrAlias::from_url(BARS_PLUGIN_URL, &Some(configuration), None, None) { ...
rust_dataset_chunk_514589
rust_dataset.txt
514,589
512
!( "{} hidden. {} or right-click → Show bars", description, shortcut ) } else { format!("{} hidden. {} to show", description, shortcut) } } fn send_hidden_bars_notice(&self, client_id: ClientId, hidden_bars: &HiddenBars) { let reque...
rust_dataset_chunk_514590
rust_dataset.txt
514,590
512
) .map(|tab| (tab.bar_count(), tab.visible_bar_count())) .unwrap_or((0, 0)); let is_bar_menu = context.kind == ContextMenuKind::Bar; let nothing_is_hidden = self.hidden_bars.is_empty(); entries .into_iter() .filter_map(|entry| match entry { ...
rust_dataset_chunk_514591
rust_dataset.txt
514,591
512
MouseEventType}; use zellij_utils::pane_mirror::MirrorTransportEvent; use zellij_utils::position::Position; pub(crate) const NO_LIVE_VIEW: &str = "The focused pane has no live view"; pub(crate) const LIVE_VIEW_IS_VIEW_ONLY: &str = "The live view is view-only"; fn target_of(view: &LiveView) -> Option<PaneAddress> { ...
rust_dataset_chunk_514592
rust_dataset.txt
514,592
512
Id) -> bool { matches!( self.get_client_input_mode(client_id), Some(InputMode::RenameTab | InputMode::RenamePane | InputMode::EnterSearch) ) } fn client_may_have_live_views(&self, client_id: ClientId) -> bool { !self.watcher_clients.contains_key(&client_id) ...
rust_dataset_chunk_514593
rust_dataset.txt
514,593
512
else { let removed = self.live_views.borrow_mut().remove(&key); if let Some(slot) = removed { let released_by = if slot.input_captured { Some(LiveViewRelease::Cleared) } else { slot.released_by }; ...
rust_dataset_chunk_514594
rust_dataset.txt
514,594
512
(target, viewer_size); slot.redraw(update.redraw); } else { slot.view.resized(viewer_size); } moved } else { let released_by = live_views .remove(&key) .and_then(|o...
rust_dataset_chunk_514595
rust_dataset.txt
514,595
512
return false; } self.release_live_view_input(client_id, LiveViewRelease::Key); true } pub(crate) fn release_live_view_input(&mut self, client_id: ClientId, reason: LiveViewRelease) { if self .live_views .borrow_mut() .release_clien...
rust_dataset_chunk_514596
rust_dataset.txt
514,596
512
_of_client(client_id); self.forget_live_views(keys); } pub(crate) fn handle_live_view_transport_event( &mut self, view_id: u32, generation: u64, event: MirrorTransportEvent, ) { let handled = { let mut live_views = self.live_views.borrow_mut(); ...
rust_dataset_chunk_514597
rust_dataset.txt
514,597
512
self.live_views.borrow_mut().announce_captures(); } pub(crate) fn sync_live_views(&mut self) { if self.live_views.borrow().is_empty() { self.announce_live_view_captures(); return; } let keys = self.live_views.borrow().keys(); let mut gone = vec![]...
rust_dataset_chunk_514598
rust_dataset.txt
514,598
512
_kitty_keyboard_protocol, ); outcome == LiveViewKeyOutcome::Sent } pub(crate) fn handle_live_view_mouse_event( &mut self, event: &MouseEvent, client_id: ClientId, ) -> bool { self.release_live_view_if_unreachable(client_id); let Some((plugin_pane_id, ...
rust_dataset_chunk_514599
rust_dataset.txt
514,599
512
let covered = self .get_active_tab(client_id) .map(|tab| tab.live_view_point_is_covered(client_id, plugin_pane_id, &event.position)) .unwrap_or(false); if covered { return false; } let inside = line >= 0 && area.contains(column, line as usize); ...