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_514200
rust_dataset.txt
514,200
512
Type::ChangeApplicationState, cache_path, plugin_thread_sender, client_id ); let plugin_should_float = Some(false); let plugin_title = Some("test_plugin".to_owned()); let run_plugin = RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: ...
rust_dataset_chunk_514201
rust_dataset.txt
514,201
512
received_screen_instructions, ScreenInstruction::CopyTextToClipboard, screen_receiver, 1, &PermissionType::WriteToClipboard, cache_path, plugin_thread_sender, client_id ); let plugin_should_float = Some(false); let plugin_title = Some("test_plugin".t...
rust_dataset_chunk_514202
rust_dataset.txt
514,202
512
let (plugin_thread_sender, screen_receiver, teardown) = create_plugin_thread(Some(plugin_host_folder), None); let received_screen_instructions = Arc::new(Mutex::new(vec![])); let client_id = 1; let screen_thread = deny_permissions_and_log_actions_in_thread!( received_screen_instruction...
rust_dataset_chunk_514203
rust_dataset.txt
514,203
512
#[ignore] pub fn generate_random_name_plugin_command() { let temp_folder = tempdir().unwrap(); let plugin_host_folder = PathBuf::from(temp_folder.path()); let cache_path = plugin_host_folder.join("permissions_test.kdl"); let (plugin_thread_sender, screen_receiver, teardown) = create_plugin_threa...
rust_dataset_chunk_514204
rust_dataset.txt
514,204
512
_assets { let plugin_bytes = plugin_render_asset.bytes.clone(); let plugin_bytes = String::from_utf8_lossy(plugin_bytes.as_slice()).to_string(); if plugin_bytes.contains("Generated name") { return Some(plugin_bytes); ...
rust_dataset_chunk_514205
rust_dataset.txt
514,205
512
_ctrl_modifier() .with_shift_modifier(), ), )])); screen_thread.join().unwrap(); teardown(); let plugin_bytes_event = received_screen_instructions .lock() .unwrap() .iter() .find_map(|i| { if let ScreenInstruction::PluginBytes(plugin_...
rust_dataset_chunk_514206
rust_dataset.txt
514,206
512
std::thread::sleep(std::time::Duration::from_millis(500)); // Send Ctrl+Shift+C to trigger dump_layout("nonexistent_layout_xyz") let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![( None, Some(client_id), Event::Key( KeyWithModifier::new(BareKey::Char('c'))...
rust_dataset_chunk_514207
rust_dataset.txt
514,207
512
::AddClient(client_id)); let _ = plugin_thread_sender.send(PluginInstruction::Load( plugin_should_float, false, false, // close_replaced_pane plugin_title, run_plugin, Some(tab_index), None, client_id, size, None, None, ...
rust_dataset_chunk_514208
rust_dataset.txt
514,208
512
_host_cmd: false, location: RunPluginLocation::File(PathBuf::from(&*PLUGIN_FIXTURE)), configuration: Default::default(), ..Default::default() }); let tab_index = 1; let client_id = 1; let size = Size { cols: 121, rows: 20, }; let _ = plugin_thread_sender....
rust_dataset_chunk_514209
rust_dataset.txt
514,209
512
let plugin_title = Some("test_plugin".to_owned()); let run_plugin = RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from(&*PLUGIN_FIXTURE)), configuration: Default::default(), ..Default::default() }); let tab...
rust_dataset_chunk_514210
rust_dataset.txt
514,210
512
cache_path, plugin_thread_sender, 1 ); let plugin_should_float = Some(false); let plugin_title = Some("test_plugin".to_owned()); let run_plugin = RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from(...
rust_dataset_chunk_514211
rust_dataset.txt
514,211
512
_screen_instructions, ScreenInstruction::PluginBytes, screen_receiver, 2, &PermissionType::ReadApplicationState, cache_path, plugin_thread_sender, 1 ); let plugin_should_float = Some(false); let plugin_title = Some("test_plugin".to_owned()); let r...
rust_dataset_chunk_514212
rust_dataset.txt
514,212
512
= PathBuf::from(temp_folder.path()); let cache_path = plugin_host_folder.join("permissions_test.kdl"); let (plugin_thread_sender, screen_receiver, teardown) = create_plugin_thread(Some(plugin_host_folder.clone()), None); let received_screen_instructions = Arc::new(Mutex::new(vec![])); let scre...
rust_dataset_chunk_514213
rust_dataset.txt
514,213
512
8_lossy(plugin_bytes.as_slice()).to_string(); if plugin_bytes.contains("Parse error:") { return Some(plugin_bytes); } } } None }); assert_snapshot!(format!("{:#?}", plugin_bytes_event)); } #[test] #[igno...
rust_dataset_chunk_514214
rust_dataset.txt
514,214
512
let plugin_bytes_event = received_screen_instructions .lock() .unwrap() .iter() .find_map(|i| { if let ScreenInstruction::PluginBytes(plugin_render_assets) = i { for plugin_render_asset in plugin_render_assets { let plugin_bytes = plugi...
rust_dataset_chunk_514215
rust_dataset.txt
514,215
512
+A to save the layout first time let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![( None, Some(client_id), Event::Key( KeyWithModifier::new(BareKey::Char('a')) .with_ctrl_modifier() .with_alt_modifier(), ), )])); st...
rust_dataset_chunk_514216
rust_dataset.txt
514,216
512
(&*PLUGIN_FIXTURE)), configuration: Default::default(), ..Default::default() }); let tab_index = 1; let client_id = 1; let size = Size { cols: 121, rows: 20, }; let _ = plugin_thread_sender.send(PluginInstruction::AddClient(client_id)); let _ = plugin_thread_...
rust_dataset_chunk_514217
rust_dataset.txt
514,217
512
ChangeApplicationState, cache_path, plugin_thread_sender, 1 ); let plugin_should_float = Some(false); let plugin_title = Some("test_plugin".to_owned()); let run_plugin = RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocat...
rust_dataset_chunk_514218
rust_dataset.txt
514,218
512
(plugin_thread_sender, screen_receiver, teardown) = create_plugin_thread(Some(plugin_host_folder.clone()), None); let received_screen_instructions = Arc::new(Mutex::new(vec![])); let screen_thread = grant_permissions_and_log_actions_in_thread!( received_screen_instructions, ScreenInstr...
rust_dataset_chunk_514219
rust_dataset.txt
514,219
512
.iter() .rev() .find_map(|i| { if let ScreenInstruction::PluginBytes(plugin_render_assets) = i { for plugin_render_asset in plugin_render_assets { let plugin_bytes = plugin_render_asset.bytes.clone(); let plugin_bytes = String::...
rust_dataset_chunk_514220
rust_dataset.txt
514,220
512
, false, None, None, None, )); std::thread::sleep(std::time::Duration::from_millis(500)); // Send Ctrl+Alt+F to rename nonexistent layout let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![( None, Some(client_id), Event::Key( ...
rust_dataset_chunk_514221
rust_dataset.txt
514,221
512
= plugin_thread_sender.send(PluginInstruction::AddClient(client_id)); let _ = plugin_thread_sender.send(PluginInstruction::Load( plugin_should_float, false, false, // close_replaced_pane plugin_title, run_plugin, Some(tab_index), None, client_id, ...
rust_dataset_chunk_514222
rust_dataset.txt
514,222
512
_command() { let temp_folder = tempdir().unwrap(); let plugin_host_folder = PathBuf::from(temp_folder.path()); let cache_path = plugin_host_folder.join("permissions_test.kdl"); let (plugin_thread_sender, screen_receiver, teardown) = create_plugin_thread(Some(plugin_host_folder.clone()), None); ...
rust_dataset_chunk_514223
rust_dataset.txt
514,223
512
_asset.bytes.clone(); let plugin_bytes = String::from_utf8_lossy(plugin_bytes.as_slice()).to_string(); if plugin_bytes.contains("Delete") { return Some(plugin_bytes); } } } None }); as...
rust_dataset_chunk_514224
rust_dataset.txt
514,224
512
_modifier(), ), )])); screen_thread.join().unwrap(); teardown(); let plugin_bytes_event = received_screen_instructions .lock() .unwrap() .iter() .find_map(|i| { if let ScreenInstruction::PluginBytes(plugin_render_assets) = i { for plu...
rust_dataset_chunk_514225
rust_dataset.txt
514,225
512
}; let _ = plugin_thread_sender.send(PluginInstruction::AddClient(client_id)); let _ = plugin_thread_sender.send(PluginInstruction::Load( plugin_should_float, false, false, // close_replaced_pane plugin_title, run_plugin, Some(tab_index), None, c...
rust_dataset_chunk_514226
rust_dataset.txt
514,226
512
PluginLocation::File(PathBuf::from(&*PLUGIN_FIXTURE)), configuration: Default::default(), ..Default::default() }); let tab_index = 1; let client_id = 1; let size = Size { cols: 121, rows: 20, }; let _ = plugin_thread_sender.send(PluginInstruction::AddClient(clien...
rust_dataset_chunk_514227
rust_dataset.txt
514,227
512
_owned()); let run_plugin = RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from(&*PLUGIN_FIXTURE)), configuration: Default::default(), ..Default::default() }); let tab_index = 1; let size = Size { co...
rust_dataset_chunk_514228
rust_dataset.txt
514,228
512
_host_folder.join("permissions_test.kdl"); let (plugin_thread_sender, screen_receiver, teardown) = create_plugin_thread(Some(plugin_host_folder.clone()), None); let received_screen_instructions = Arc::new(Mutex::new(vec![])); let client_id = 1; let screen_thread = deny_permissions_and_log_acti...
rust_dataset_chunk_514229
rust_dataset.txt
514,229
512
plugin_render_asset in plugin_render_assets { let plugin_bytes = plugin_render_asset.bytes.clone(); let plugin_bytes = String::from_utf8_lossy(plugin_bytes.as_slice()).to_string(); if plugin_bytes.contains("Save layout") { return Some(...
rust_dataset_chunk_514230
rust_dataset.txt
514,230
512
illis(500)); let mut new_config = BTreeMap::new(); new_config.insert("theme".to_owned(), "light".to_owned()); // Changed new_config.insert("size".to_owned(), "small".to_owned()); // Changed let mut plugin_aliases = PluginAliases::default(); plugin_aliases.aliases.insert( "test_plugin".to_o...
rust_dataset_chunk_514231
rust_dataset.txt
514,231
512
initial_config = BTreeMap::new(); initial_config.insert("theme".to_owned(), "dark".to_owned()); let plugin_should_float = Some(false); let plugin_title = Some("test_plugin".to_owned()); let run_plugin = RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunP...
rust_dataset_chunk_514232
rust_dataset.txt
514,232
512
teardown(); // Verify plugin did NOT receive PluginConfigurationChanged event let plugin_renders = received_screen_instructions .lock() .unwrap() .iter() .filter_map(|i| { if let ScreenInstruction::PluginBytes(plugin_render_assets) = i { for plugi...
rust_dataset_chunk_514233
rust_dataset.txt
514,233
512
let size = Size { cols: 121, rows: 20, }; let _ = plugin_thread_sender.send(PluginInstruction::AddClient(client_id)); let _ = plugin_thread_sender.send(PluginInstruction::Load( plugin_should_float, false, false, // close_replaced_pane plugin_title, r...
rust_dataset_chunk_514234
rust_dataset.txt
514,234
512
}); let tab_index = 1; let client_id = 1; let size = Size { cols: 121, rows: 20, }; let received_screen_instructions = Arc::new(Mutex::new(vec![])); let screen_thread = grant_permissions_and_log_actions_in_thread_struct_variant!( received_screen_instructions, ...
rust_dataset_chunk_514235
rust_dataset.txt
514,235
512
(); let plugin_host_folder = PathBuf::from(temp_folder.path()); let cache_path = plugin_host_folder.join("permissions_test.kdl"); let (plugin_thread_sender, screen_receiver, teardown) = create_plugin_thread(None, None); let plugin_should_float = Some(false); let plugin_title = Some("test_plugin".to_...
rust_dataset_chunk_514236
rust_dataset.txt
514,236
512
PluginHighlights instruction" ); let (pane_id, _plugin_id) = clear_instruction.unwrap(); assert_eq!(pane_id, PaneId::Terminal(1)); } #[test] #[ignore] pub fn highlight_clicked_event_delivered_to_plugin() { let temp_folder = tempdir().unwrap(); let plugin_host_folder = PathBuf::from(temp_folder.path...
rust_dataset_chunk_514237
rust_dataset.txt
514,237
512
lock() .unwrap() .iter() .find_map(|i| { if let ScreenInstruction::PluginBytes(plugin_render_assets) = i { for plugin_render_asset in plugin_render_assets { let plugin_bytes = plugin_render_asset.bytes.clone(); let plugin_bytes ...
rust_dataset_chunk_514238
rust_dataset.txt
514,238
512
PluginUserConfiguration::new(config_b), ..Default::default() }); let received_screen_instructions = Arc::new(Mutex::new(vec![])); // Spawn a screen thread that grants permissions and collects all instructions until Exit let screen_thread = std::thread::Builder::new() .name("fake_screen...
rust_dataset_chunk_514239
rust_dataset.txt
514,239
512
::HashMap::new(); mode_map.insert(KeyWithModifier::new(BareKey::Char('q')), vec![Action::Quit]); keybind_map.insert(InputMode::Normal, mode_map); let test_keybinds = Keybinds(keybind_map); let _ = plugin_thread_sender.send(PluginInstruction::Reconfigure { client_id, keybinds: Some(std::...
rust_dataset_chunk_514240
rust_dataset.txt
514,240
512
legacy) should receive full ModeUpdate with keybinds" ); assert!( plugin_b_has_empty_keybinds, "Plugin B (InitialKeybinds subscriber) should receive ModeUpdate with empty keybinds" ); } #[test] #[ignore] pub fn reconfiguration_resends_keybinds_to_opted_in_plugins() { let temp_folder = t...
rust_dataset_chunk_514241
rust_dataset.txt
514,241
512
let _ = plugin_thread_sender.send(PluginInstruction::AddClient(client_id)); let _ = plugin_thread_sender.send(PluginInstruction::Load( plugin_should_float, false, false, Some("test_plugin".to_owned()), run_plugin, Some(tab_index), None, client_id, ...
rust_dataset_chunk_514242
rust_dataset.txt
514,242
512
the new keybinds.\nexpected to find: {}\nin: {}", expected_event, last_render ); } #[test] #[ignore] pub fn cli_pipe_is_released_when_plugin_panics_while_handling_it() { let temp_folder = tempdir().unwrap(); let plugin_host_folder = PathBuf::from(temp_folder.path()); let cache_path = p...
rust_dataset_chunk_514243
rust_dataset.txt
514,243
512
plugin: None, args: None, configuration: None, floating: None, pane_id_to_replace: None, pane_title: None, cwd: None, skip_cache: false, cli_client_id: client_id, caller_pane_id: None, popup: None, popup_focused: true, popu...
rust_dataset_chunk_514244
rust_dataset.txt
514,244
512
= rendered.clone(); let keybinds_requests = keybinds_requests.clone(); let request_to_result = request_to_result.clone(); let cache_path = cache_path.clone(); let plugin_thread_sender = plugin_thread_sender.clone(); move || { let mut unanswere...
rust_dataset_chunk_514245
rust_dataset.txt
514,245
512
plugin_thread_sender.send(PluginInstruction::Load( Some(false), false, false, Some(format!("plugin_{}", index)), run_plugin, Some(1), None, client_id, size, None, None, false,...
rust_dataset_chunk_514246
rust_dataset.txt
514,246
512
let scenario = run_nested_keybinds_scenario( vec![BTreeMap::new()], NestedKeybindsAnswer::Reply(Ok(sample_nested_session_keybinds())), vec![nested_keybinds_key()], "Nested keybinds", ); assert_eq!(scenario.keybinds_requests, 1); assert!( scenario.rendered.iter().any(...
rust_dataset_chunk_514247
rust_dataset.txt
514,247
512
test] #[ignore] pub fn get_nested_session_keybinds_answers_only_the_plugin_that_asked() { let asking_plugin = BTreeMap::new(); let mut other_plugin = BTreeMap::new(); other_plugin.insert("skip_nested_keybinds_request".to_owned(), "true".to_owned()); other_plugin.insert( "subscribe_nested_session...
rust_dataset_chunk_514248
rust_dataset.txt
514,248
512
_path: vec!["middle".to_owned(), "inner".to_owned()], mode: InputMode::Locked, base_mode: Some(InputMode::Normal), keybinds_generation: 3, }, Event::NestedSessionEnded { pane_id: zellij_utils::data::PaneId::Terminal(1), ...
rust_dataset_chunk_514249
rust_dataset.txt
514,249
512
::Instant::now() + std::time::Duration::from_secs(5); let mut update_sent = false; let mut rendered_after_unload = false; while std::time::Instant::now() < deadline { if !update_sent && deadline - std::time::Instant::now() < std::time::Duration::from_secs(3) { let _ = plugin_thre...
rust_dataset_chunk_514250
rust_dataset.txt
514,250
512
::PluginConfig { path: PathBuf::from("/tmp/third-party.wasm"), _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from("/tmp/third-party.wasm")), initial_userspace_configuration: PluginUserConfiguration::new(BTreeMap::new()), initial_cwd: ...
rust_dataset_chunk_514251
rust_dataset.txt
514,251
512
: 1, }), ..Default::default() }; zellij_utils::data::PaneManifest { panes: [(0, vec![pane_info])].into_iter().collect(), } } fn manifest_leaks_command_text(manifest: &zellij_utils::data::PaneManifest) -> bool { manifest.panes.values().flatten().any(|pane_info| { pane_inf...
rust_dataset_chunk_514252
rust_dataset.txt
514,252
512
TerminalRequest}; let session_name = "other-session".to_owned(); let pane_id = PaneId::Terminal(1); vec![ ( PluginCommand::MarkSessionPaneSeen { session_name: session_name.clone(), pane_id, }, PermissionType::ChangeApplicationState,...
rust_dataset_chunk_514253
rust_dataset.txt
514,253
512
?}", command, required ); let everything_else: Vec<PermissionType> = EVERY_PERMISSION .iter() .filter(|permission| **permission != required) .cloned() .collect(); let denied = plugin_env_with_permissions(&everything_else); ...
rust_dataset_chunk_514254
rust_dataset.txt
514,254
512
Attention::build( "here", vec![( "api".to_owned(), SessionAttention { status: item.attention.status, counts, muted: false, top: Some(item.clone()), items: vec![item], }, )], ) ...
rust_dataset_chunk_514255
rust_dataset.txt
514,255
512
] pub fn pane_attention_changed_hides_the_command_text_without_pane_read_permission() { let event = Event::PaneAttentionChanged( zellij_utils::data::PaneId::Terminal(1), attention_with_command_text(), ); assert!(!redacted(&WITHOUT_PANE_READ, event.clone()).contains("hunter2")); assert!(r...
rust_dataset_chunk_514256
rust_dataset.txt
514,256
512
::new(false)); let screen_log = Arc::new(Mutex::new(vec![])); let screen_thread = std::thread::Builder::new() .name("fake_screen_thread".to_string()) .spawn({ let stop = stop.clone(); let answered = answered.clone(); let screen_log = screen_log.clone(); ...
rust_dataset_chunk_514257
rust_dataset.txt
514,257
512
_)) => break, Ok((job, _)) => background_jobs_log.lock().unwrap().push(job), Err(_) => {}, } } }) .unwrap(); let mut configuration = BTreeMap::new(); configuration.insert("attention_fixture".to_owned(), "true".to_owned()); ...
rust_dataset_chunk_514258
rust_dataset.txt
514,258
512
_super_modifier()), )])); } fn send_event(sender: &SenderWithContext<PluginInstruction>, event: Event) { let _ = sender.send(PluginInstruction::Update(vec![(None, None, event)])); } const SESSION_PANE_KEYS: [(char, &str); 8] = [ ('j', "MarkSeen(Terminal(1))"), ('k', "MarkAllSeen Some(\"other-session\"...
rust_dataset_chunk_514259
rust_dataset.txt
514,259
512
| command.contains("ToggleMute")), "{:?}", sent ); assert!( !sent .iter() .any(|command| command.contains("Write(") || command.contains("Key(")), "{:?}", sent ); } #[test] #[ignore] pub fn get_pane_info_hides_the_command_text_without_pane_read...
rust_dataset_chunk_514260
rust_dataset.txt
514,260
512
); } #[test] #[ignore] pub fn command_finished_reaches_a_subscribed_plugin() { let run = run_attention_fixture(&WITH_PANE_READ, |sender| { send_event( sender, Event::CommandFinished(zellij_utils::data::PaneId::Terminal(6), command_outcome()), ) }); let rendered ...
rust_dataset_chunk_514261
rust_dataset.txt
514,261
512
-session") && rendered.contains("attention_muted: true"), "{}", rendered ); } #[test] #[ignore] pub fn session_update_lists_the_running_plugins_of_the_current_session() { let run = run_attention_fixture(&WITH_PANE_READ, |sender| { send_event( sender, Event::Sessi...
rust_dataset_chunk_514262
rust_dataset.txt
514,262
512
String>, } impl SettingsEntriesScenario { fn load_subscribed_fixture(&mut self) { let mut configuration = BTreeMap::new(); configuration.insert("subscribe_settings_entries".to_owned(), "true".to_owned()); let run_plugin = RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host...
rust_dataset_chunk_514263
rust_dataset.txt
514,263
512
receive_until(&mut self, done: impl Fn(&Self) -> bool) -> bool { let deadline = std::time::Instant::now() + std::time::Duration::from_secs(10); while !done(self) { let remaining = deadline.saturating_duration_since(std::time::Instant::now()); if remaining.is_zero() { ...
rust_dataset_chunk_514264
rust_dataset.txt
514,264
512
.send_key_to_all('o'); scenario.wait_for_entries(0, "PluginSettingsEntries([])"); }); } #[test] #[ignore] pub fn a_plugin_loaded_later_receives_the_registered_settings_entries() { run_settings_entries_scenario(|scenario| { scenario.load_subscribed_fixture(); scenario.send_key_to_all('n'...
rust_dataset_chunk_514265
rust_dataset.txt
514,265
512
PluginInstruction}; use crate::screen::ScreenInstruction; use crate::ClientId; use std::collections::{BTreeMap, HashMap, HashSet}; use std::path::PathBuf; use std::time::{Duration, Instant}; use tempfile::tempdir; use zellij_utils::channels::{Receiver, SenderWithContext}; use zellij_utils::data::{BareKey, Event, KeyWi...
rust_dataset_chunk_514266
rust_dataset.txt
514,266
512
<PluginInstruction>, cache_path: PathBuf, renders: Renders, render_log: Vec<(PluginId, ClientId, String)>, collapsed: HashSet<PaneId>, granted: Vec<PluginId>, } impl ScreenLog { fn new( receiver: Receiver<(ScreenInstruction, ErrorContext)>, plugin_thread_sender: SenderWithContex...
rust_dataset_chunk_514267
rust_dataset.txt
514,267
512
_secs(30); while self.granted.len() < count { if Instant::now() > deadline { panic!("timed out waiting for {} permission grants", count); } self.receive_one(Duration::from_millis(100)); } } fn settle(&mut self, duration: Duration) { let...
rust_dataset_chunk_514268
rust_dataset.txt
514,268
512
(&[("label", "b")]), 1, client_id); load(&sender, shared_fixture(&[("label", "c")]), 2, client_id); screen.wait_until("three slots rendered", |renders| { slots_of_client(renders, client_id).len() == 3 }); let first_slot = slots_of_client(&screen.renders, client_id)[0]; let _ = sender.send(Pl...
rust_dataset_chunk_514269
rust_dataset.txt
514,269
512
0, client_id, ); load( &sender, shared_fixture(&[("instance", "two"), ("label", "b")]), 0, client_id, ); load( &sender, shared_fixture(&[("instance", "one"), ("label", "c")]), 1, client_id, ); screen.wait_until("three slots...
rust_dataset_chunk_514270
rust_dataset.txt
514,270
512
1 && slots_of_client(renders, 2).len() == 1 }); let slot_id = slots_of_client(&screen.renders, 1)[0]; assert_eq!(field(&screen.renders[&(slot_id, 1)], "client"), "1"); assert_eq!(field(&screen.renders[&(slot_id, 2)], "client"), "2"); let renders_before_key = screen.render_log.len(); let _ = send...
rust_dataset_chunk_514271
rust_dataset.txt
514,271
512
knows the other slot was removed", |renders| { let rendered = &renders[&(remaining_slot, client_id)]; field(rendered, "removed") == format!("[{}]", closed_slot) && field(rendered, "slots") == format!("[{}]", remaining_slot) }, ); screen.settle(Duration::f...
rust_dataset_chunk_514272
rust_dataset.txt
514,272
512
, "instance")) .collect(); assert_eq!(instances.len(), 1); assert!(screen .renders .values() .all(|rendered| field(rendered, "loads") == "1")); } #[test] #[ignore] pub fn shared_plugin_slot_commands_are_checked() { let (sender, mut screen, teardown, _temp_folder) = start(); ...
rust_dataset_chunk_514273
rust_dataset.txt
514,273
512
_fixture(&[("label", "b"), ("collapse_on_render", "true")]), 1, client_id, ); screen.wait_until("two slots rendered", |renders| { slots_of_client(renders, client_id).len() == 2 }); let slots = slots_of_client(&screen.renders, client_id); let expected: HashSet<PaneId> = slots ...
rust_dataset_chunk_514274
rust_dataset.txt
514,274
512
collect(); let deadline = Instant::now() + Duration::from_secs(30); while screen.collapsed != expected && Instant::now() < deadline { screen.receive_one(Duration::from_millis(100)); } teardown(); assert_eq!( screen.collapsed, expected, "every slot of the plugin is collapsed, ...
rust_dataset_chunk_514275
rust_dataset.txt
514,275
512
true".to_owned()); RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(fixture_path("fixture-plugin-for-tests")), configuration: PluginUserConfiguration::new(configuration), ..Default::default() }) } fn observed_settings_entries...
rust_dataset_chunk_514276
rust_dataset.txt
514,276
512
| { observed_settings_entries(renders) .map(|entries| entries.contains("Shared settings")) .unwrap_or(false) }); slot_id } #[test] #[ignore] pub fn a_crashed_shared_plugin_loses_its_settings_entry() { let (sender, mut screen, teardown, _temp_folder) = start(); let client...
rust_dataset_chunk_514277
rust_dataset.txt
514,277
512
bounded(); let (to_screen, screen_receiver) = channels::unbounded(); let senders = ThreadSenders { to_plugin: Some(SenderWithContext::new(to_plugin)), to_screen: Some(SenderWithContext::new(to_screen)), should_silently_fail: true, ..Default::default() }; let plugin_dir = ...
rust_dataset_chunk_514278
rust_dataset.txt
514,278
512
PermissionRequestResult); } let (shutdown_sender, _shutdown_receiver) = tokio::sync::mpsc::channel(1); bridge .update_plugins( vec![ ( Some(plugin_ids[0]), Some(client_id + 1), Event::PermissionRequestResult(Perm...
rust_dataset_chunk_514279
rust_dataset.txt
514,279
512
} } } --- FILE: zellij/zellij-server/src/plugins/wasm_bridge.rs --- use super::{PinnedExecutor, PluginId, PluginInstruction}; use crate::global_async_runtime::get_tokio_runtime; use crate::plugins::pipes::{ apply_pipe_message_to_plugin, pipes_to_block_or_unblock, PendingPipes, PipeRelease, PipeStateChang...
rust_dataset_chunk_514280
rust_dataset.txt
514,280
512
event::{event_to_protobuf_with_keybinds, ProtobufEvent}; use zellij_utils::plugin_api::released_contract; use prost::Message; use crate::panes::PaneId; use crate::{ background_jobs::BackgroundJob, route::NotificationEnd, screen::ScreenInstruction, thread_bus::ThreadSenders, ui::loading_indication::LoadingIndi...
rust_dataset_chunk_514281
rust_dataset.txt
514,281
512
{ PluginRenderAsset { client_id, plugin_id, bytes, ..Default::default() } } pub fn with_pipes(mut self, cli_pipes: HashMap<String, PipeStateChange>) -> Self { self.cli_pipes = cli_pipes; self } pub fn rendered_at(mut self, ...
rust_dataset_chunk_514282
rust_dataset.txt
514,282
512
_to_default_shell.clone(), session_env_vars: wasm_bridge.session_env_vars.clone(), plugin_cwd: cwd.unwrap_or_else(|| wasm_bridge.zellij_cwd.clone()), default_shell: wasm_bridge.default_shell.clone(), layout_dir: wasm_bridge.layout_dir.clone(), keybinds, ...
rust_dataset_chunk_514283
rust_dataset.txt
514,283
512
(crate) fn subscription_event_type( event: &Event, ) -> Result<EventType, <EventType as FromStr>::Err> { EventType::from_str(&event.to_string()).map(|event_type| { if event_type == EventType::MouseWithModifiers { EventType::Mouse } else { event_type } }) } pu...
rust_dataset_chunk_514284
rust_dataset.txt
514,284
512
: Option<PaneRenderReport>, last_host_terminal_theme_mode: Option<HostTerminalThemeMode>, pub last_global_attention: Option<zellij_utils::attention::GlobalAttention>, pub session_history_infos: HashMap<ClientId, zellij_utils::session_history::SessionHistoryInfo>, pub last_session_save_time: Arc<Mutex<Op...
rust_dataset_chunk_514285
rust_dataset.txt
514,285
512
plugins_to_unload_once_loaded: HashSet::new(), pending_plugin_reloads: HashSet::new(), zellij_cwd, session_env_vars, default_shell, cached_plugin_map: HashMap::new(), pending_pipes: Default::default(), pipe_popups: HashMap::...
rust_dataset_chunk_514286
rust_dataset.txt
514,286
512
.contains(&client_id) { Some(client_id) } else { None } }) .or_else(|| { // if no client id was provided, try to use the first connected client self.connected_clients .lock...
rust_dataset_chunk_514287
rust_dataset.txt
514,287
512
Remote(_)); let mut loading_context = LoadingContext::new( &self, Some(zellij_cwd.clone()), plugin.clone(), // TODO: rename to plugin_config plugin_id, client_id, tab_index, ...
rust_dataset_chunk_514288
rust_dataset.txt
514,288
512
(plugin_id)); let mut loading_indication = LoadingIndication::new(plugin_name.clone()); self.plugin_executor.execute_plugin_load( plugin_id, move |senders, plugin_map, con...
rust_dataset_chunk_514289
rust_dataset.txt
514,289
512
unwrap(); plugin_map.remove_plugins(pid).into_iter().collect() }; // Schedule cleanup on each plugin's pinned thread for ((plugin_id, client_id), (running_plugin, subscriptions, workers)) in plugins_to_cleanup { // Clear key intercepts if needed (on main thread i...
rust_dataset_chunk_514290
rust_dataset.txt
514,290
512
drop(subscriptions); }, ); } // Main thread cleanup self.cached_plugin_map.clear(); let pipes_to_release = self.pending_pipes.unload_plugin(&pid); self.send_pipe_releases(pipes_to_release); self.forget_pipe_popups_of_plugin(pid); let ...
rust_dataset_chunk_514291
rust_dataset.txt
514,291
512
return Ok(()); }; let Some(plugin_config) = self.plugin_config_of_plugin_id(plugin_id) else { log::error!("Could not find running plugin with id: {}", plugin_id); return Ok(()); }; let tab_index = self.tab_index_of_plugin_id(plugin_id); let Som...
rust_dataset_chunk_514292
rust_dataset.txt
514,292
512
} for instance_id in instance_ids { self.reload_shared_instance(instance_id); } return Ok(()); } } if self.plugin_is_currently_being_loaded(&run_plugin.location) { self.pending_plugin_reloads.inse...
rust_dataset_chunk_514293
rust_dataset.txt
514,293
512
_plugin_id(plugin_id) else { log::error!( "Could not find size of running plugin with id: {}", plugin_id ); return Ok(()); }; let size = Size { rows: size.0, cols: size.1, ...
rust_dataset_chunk_514294
rust_dataset.txt
514,294
512
); }, ); return Ok(()); } let plugins_to_resize: Vec<(PluginId, ClientId, Arc<Mutex<RunningPlugin>>)> = self .plugin_map .lock() .unwrap() .running_plugins() .iter() .cloned() .fi...
rust_dataset_chunk_514295
rust_dataset.txt
514,295
512
Ok(rendered_bytes) => { let plugin_render_asset = PluginRenderAsset::new( plugin_id, client_id, rendered_bytes.as_bytes().to_vec(), ...
rust_dataset_chunk_514296
rust_dataset.txt
514,296
512
let Ok(event_type) = subscription_event_type(&event) { if (subs.contains(&event_type) || event_type == EventType::PermissionRequestResult) && Self::message_is_directed_at_plugin(pid, cid, plugin_id, client_id) { ...
rust_dataset_chunk_514297
rust_dataset.txt
514,297
512
pending plugins (probably currently // being loaded, we'll send them these events when they load) for (pid, cid, event) in updates.drain(..) { for (plugin_id, cached_events) in self.cached_events_for_pending_plugins.iter_mut() { if pid.is_none() || pid.as_ref() == Some(plugi...
rust_dataset_chunk_514298
rust_dataset.txt
514,298
512
PluginId, client_id_to_update: ClientId, ) -> Result<()> { if let Some(instance_id) = self.shared_instance_of(plugin_id_to_update) { self.plugin_executor.execute_for_plugin( instance_id, move |senders, plugin_map, _connected_clients, _plugin_cache, _engin...
rust_dataset_chunk_514299
rust_dataset.txt
514,299
512
_host_dir.display(), e ); let _ = senders.send_to_plugin(PluginInstruction::Update(vec![( Some(plugin_id_to_update), Some(client_id_to_update), ...