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_518100
rust_dataset.txt
518,100
512
Id) -> Self { let new_plugin_args = self.new_plugin_args.get_or_insert_with(Default::default); new_plugin_args.pane_id_to_replace = Some(pane_id); self } pub fn new_plugin_instance_should_have_pane_title( mut self, pane_title: impl Into<String>, ) -> Self { le...
rust_dataset_chunk_518101
rust_dataset.txt
518,101
512
) -> bool { self.session_name.is_none() || self.layout.is_some() } } #[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)] pub struct ConnectToSession { pub name: Option<String>, pub tab_position: Option<usize>, pub pane_id: Option<(u32, bool)>, // (id, is_plugin) pub layout: ...
rust_dataset_chunk_518102
rust_dataset.txt
518,102
512
bind here? PromptRequest { caller_plugin_id: u32, request_id: u64, }, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)] pub enum PopupCorner { TopLeft, TopRight, BottomLeft, BottomRight, } impl PopupCorner { pub fn is_top(&self) -> bool { ...
rust_dataset_chunk_518103
rust_dataset.txt
518,103
512
{ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { OutsideClick::Block => write!(f, "block"), OutsideClick::Close => write!(f, "close"), } } } #[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] #[non_exhaustive] pub struct PopupOptio...
rust_dataset_chunk_518104
rust_dataset.txt
518,104
512
" => Ok(PipePopupPlacement::Center), "mouse" => Ok(PipePopupPlacement::Mouse), "cursor" => Ok(PipePopupPlacement::Cursor), "top-left" => Ok(PipePopupPlacement::TopLeft), "top-right" => Ok(PipePopupPlacement::TopRight), "bottom-left" => Ok(PipePopupPlacement::B...
rust_dataset_chunk_518105
rust_dataset.txt
518,105
512
pub pinned: Option<bool>, pub borderless: Option<bool>, #[serde(default)] pub border_style: Option<BorderStyleOverride>, } impl FloatingPaneCoordinates { pub fn new( x: Option<String>, y: Option<String>, width: Option<String>, height: Option<String>, pinned: ...
rust_dataset_chunk_518106
rust_dataset.txt
518,106
512
self } pub fn with_x_percent(mut self, x: usize) -> Self { if x > 100 { eprintln!("x must be between 0 and 100"); return self; } self.x = Some(PercentOrFixed::Percent(x)); self } pub fn with_y_fixed(mut self, y: usize) -> Self { sel...
rust_dataset_chunk_518107
rust_dataset.txt
518,107
512
pub context: Context, } impl OriginatingPlugin { pub fn new(plugin_id: u32, client_id: ClientId, context: Context) -> Self { OriginatingPlugin { plugin_id, client_id, context, } } } #[derive(ValueEnum, Deserialize, Serialize, Debug, Clone, Copy, PartialEq, ...
rust_dataset_chunk_518108
rust_dataset.txt
518,108
512
iled { direction: Option<Direction>, borderless: Option<bool>, border_style: Option<BorderStyleOverride>, }, Floating(Option<FloatingPaneCoordinates>), InPlace { pane_id_to_replace: Option<PaneId>, close_replaced_pane: bool, borderless: Option<bool>, b...
rust_dataset_chunk_518109
rust_dataset.txt
518,109
512
-> Option<PaneId> { match self { NewPanePlacement::Stacked { pane_id_to_stack_under, .. } => *pane_id_to_stack_under, _ => None, } } pub fn get_borderless(&self) -> Option<bool> { match self { NewPanePlaceme...
rust_dataset_chunk_518110
rust_dataset.txt
518,110
512
Stacked { pane_id_to_stack_under, borderless, border_style, }, } } } type Context = BTreeMap<String, String>; #[derive(Debug, Clone, EnumDiscriminants, Display)] #[strum_discriminants(derive(EnumString, Hash, Serialize, Deserialize))] #[strum_dis...
rust_dataset_chunk_518111
rust_dataset.txt
518,111
512
PaneFrames, SetPaneFrameStyle(PaneFrameStyle), TogglePaneEmbedOrEject, UndoRenamePane, CloseFocus, ToggleActiveTabSync, CloseFocusedTab, UndoRenameTab, QuitZellij, PreviousSwapLayout, NextSwapLayout, ApplyTiledSwapLayout(String), ApplyFloatingSwapLayout(String), GoToT...
rust_dataset_chunk_518112
rust_dataset.txt
518,112
512
, i32), MessageToPlugin(MessageToPlugin), DisconnectOtherClients, KillSessions(Vec<String>), // one or more session names ScanHostFolder(PathBuf), // TODO: rename to ScanHostFolder WatchFilesystem, DumpSessionLayout { tab_index: Option<usize>, }, CloseSelf, NewTabsWithLayou...
rust_dataset_chunk_518113
rust_dataset.txt
518,113
512
bool - // should_change_focus_to_new_tab SwitchTabToId(u64), // u64 - tab_id GoToTabWithId(u64), // u64 - tab_id CloseTabWithId(u64), // u64 - tab_id RenameTabWithId(u64, String), // u64 - tab_id, Strin...
rust_dataset_chunk_518114
rust_dataset.txt
518,114
512
to ungroup, // bool -> for all clients HighlightAndUnhighlightPanes(Vec<PaneId>, Vec<PaneId>), // panes to highlight, panes to // unhighlight CloseMultiplePanes(Vec<PaneId>), FloatMultiplePanes(Vec<PaneId>), EmbedMultiplePanes(Vec<PaneId>), QueryWebServerStatus, SetSelfMouseSelectionSup...
rust_dataset_chunk_518115
rust_dataset.txt
518,115
512
PluginPaneInNewTab { plugin_url: String, configuration: BTreeMap<String, String>, context: Context, }, OpenEditorPaneInNewTab(FileToOpen, Context), OpenCommandPaneInPlaceOfPaneId(PaneId, CommandToRun, bool, Context), // bool = close_replaced_pane OpenTerminalPaneInPlaceOfPaneId(P...
rust_dataset_chunk_518116
rust_dataset.txt
518,116
512
, new_name: String, }, ReplaceConfigBlocks(String), SaveKeybindsAsPreset { new_name: String, }, WriteThemeFile { name: String, copy_from: Option<String>, colours: Vec<String>, }, DeleteThemeFile { name: String, }, ResetKeys { ke...
rust_dataset_chunk_518117
rust_dataset.txt
518,117
512
Ord, Ord, Serialize, Deserialize)] pub enum SettingSection { TopLevel, PaneFrames, WebClient, Terminal, TerminalTheme, Keybinds, Blocks, Attention, AttentionPopups, AttentionBadge, AttentionBadgeColors, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Ser...
rust_dataset_chunk_518118
rust_dataset.txt
518,118
512
Light => (TopLevel, "theme_light", false, Text), ExplicitThemeHue => (TopLevel, "explicit_theme_hue", false, Text), DefaultMode => (TopLevel, "default_mode", false, Text), DefaultShell => (TopLevel, "default_shell", false, Text), DefaultCwd => (TopLevel, "default_cwd", false, Text), DefaultLayout =>...
rust_dataset_chunk_518119
rust_dataset.txt
518,119
512
Level, "support_kitty_keyboard_protocol", true, Flag), SupportKittyGraphicsProtocol => (TopLevel, "support_kitty_graphics_protocol", true, Flag), GraphemeClusters => (TopLevel, "grapheme_clusters", false, Flag), MirrorResizesSourcePane => (TopLevel, "mirror_resizes_source_pane", false, Flag), LiveViewRe...
rust_dataset_chunk_518120
rust_dataset.txt
518,120
512
"web_server_cert", true, Text), WebServerKey => (TopLevel, "web_server_key", true, Text), EnforceHttpsForLocalhost => (TopLevel, "enforce_https_for_localhost", true, Flag), DangerouslyAllowWebServingWithoutACertificate => (TopLevel, "dangerously_allow_web_serving_without_a_certificate", true, Flag), Po...
rust_dataset_chunk_518121
rust_dataset.txt
518,121
512
false, Text), FrameFloatingBorderRoundedCorners => (PaneFrames, "floating_border_rounded_corners", false, Flag), WebClientFont => (WebClient, "font", true, Text), WebClientFontSize => (WebClient, "font_size", true, Number), WebClientCursorBlink => (WebClient, "cursor_blink", true, Flag), WebClientC...
rust_dataset_chunk_518122
rust_dataset.txt
518,122
512
TerminalPaddingTop => (Terminal, "padding_top", false, Decimal), TerminalPaddingRight => (Terminal, "padding_right", false, Decimal), TerminalPaddingBottom => (Terminal, "padding_bottom", false, Decimal), TerminalPaddingLeft => (Terminal, "padding_left", false, Decimal), TerminalPaddingBalance => (Term...
rust_dataset_chunk_518123
rust_dataset.txt
518,123
512
TerminalZoomResetKeys => (Terminal, "zoom_reset_keys", false, List), TerminalFullscreenKeys => (Terminal, "fullscreen_keys", false, List), TerminalColorForeground => (TerminalTheme, "foreground", false, Colour), TerminalColorBackground => (TerminalTheme, "background", false, Colour), TerminalColorCurso...
rust_dataset_chunk_518124
rust_dataset.txt
518,124
512
false, Flag), AttentionIdleRule => (Attention, "idle_rule", false, Text), AttentionDoneThresholdSecs => (Attention, "done_threshold_secs", false, Number), AttentionTrackCommands => (Attention, "track_commands", false, Flag), AttentionIdleActivitySecs => (Attention, "idle_activity_secs", false, Number),...
rust_dataset_chunk_518125
rust_dataset.txt
518,125
512
PaneFrames => format!("ui.pane_frames.{}", self.kdl_name()), SettingSection::WebClient => format!("web_client.{}", self.kdl_name()), SettingSection::Terminal => format!("terminal.{}", self.kdl_name()), SettingSection::TerminalTheme => format!("terminal.theme.{}", self.kdl_name()), ...
rust_dataset_chunk_518126
rust_dataset.txt
518,126
512
, }, SettingValueShape::Number => value .trim() .parse::<i64>() .ok() .map(|number| vec![kdl::KdlValue::Base10(number)]), SettingValueShape::Decimal => { let number = value.trim().parse::<f64>().ok()?; ...
rust_dataset_chunk_518127
rust_dataset.txt
518,127
512
fmt::Display for SettingKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.id()) } } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ConfigSettingState { pub key: SettingKey, pub saved_value: Option<String>, pub current_value: Op...
rust_dataset_chunk_518128
rust_dataset.txt
518,128
512
plugin_aliases: Vec<PluginAliasEntry>, pub load_plugins: Vec<PluginEntry>, pub env: Vec<EnvVarEntry>, pub context_menu: Vec<MenuSectionEntries>, pub themes: Vec<ThemeEntry>, } impl ConfigBlocks { pub fn menu_section(&self, section: &str) -> Vec<MenuItemEntry> { self.context_menu ...
rust_dataset_chunk_518129
rust_dataset.txt
518,129
512
_vars: Vec<String>, pub context_menu_items: Vec<String>, pub blocks: ConfigBlocks, pub saved_blocks: ConfigBlocks, pub default_blocks: ConfigBlocks, pub keybindings: Vec<KeybindingEntry>, pub keybinds: KeybindsSelectionSnapshot, pub mousebindings: Vec<MousebindingEntry>, pub font_familie...
rust_dataset_chunk_518130
rust_dataset.txt
518,130
512
PlaceResponse = Option<PaneId>; pub type OpenCommandPaneNearPluginResponse = Option<PaneId>; pub type OpenCommandPaneFloatingNearPluginResponse = Option<PaneId>; pub type OpenCommandPaneInPlaceOfPluginResponse = Option<PaneId>; pub type OpenCommandPaneBackgroundResponse = Option<PaneId>; pub type OpenCommandPaneInPlace...
rust_dataset_chunk_518131
rust_dataset.txt
518,131
512
rounded_corners: Some(true), ..Default::default() }) ); assert_eq!( BorderStyleOverride::from_cli_string("all:dashed,rounded:false"), Ok(BorderStyleOverride { all: Some(LineStyle::Dashed), rounded_corners: Some(false), ..Default...
rust_dataset_chunk_518132
rust_dataset.txt
518,132
512
{ all: Some(LineStyle::Single), top: Some(LineStyle::Double), rounded_corners: Some(true), ..Default::default() } ); } #[test] fn a_uniform_border_style_reports_its_line_style() { assert_eq!( BorderStyle { top: LineStyle::Double, ...
rust_dataset_chunk_518133
rust_dataset.txt
518,133
512
assert_eq!(text.parse::<PipePopupPlacement>(), Ok(placement)); assert_eq!(placement.to_string(), text); assert_eq!(placement.corner(), Some(corner)); assert_eq!(text.parse::<PopupCorner>(), Ok(corner)); assert_eq!(corner.to_string(), text); } assert_eq!( ...
rust_dataset_chunk_518134
rust_dataset.txt
518,134
512
_text_to_column(line, 2), "ae\u{0301}"); assert_eq!(extract_text_by_columns(line, 3, 5), "\u{1F468}\u{200D}"); } } #[cfg(all(test, not(target_family = "wasm")))] mod kitty_serialization_tests { use super::*; fn kitty(key: &str) -> Option<String> { KeyWithModifier::from_str(key).unwrap().se...
rust_dataset_chunk_518135
rust_dataset.txt
518,135
512
(), Some("\r")); assert_eq!(kitty("Tab").as_deref(), Some("\t")); assert_eq!(kitty("Backspace").as_deref(), Some("\u{7f}")); assert_eq!(kitty("Shift Enter").as_deref(), Some("\u{1b}[13;2u")); assert_eq!(kitty("Shift Tab").as_deref(), Some("\u{1b}[9;2u")); assert_eq!(kitty("Ctrl B...
rust_dataset_chunk_518136
rust_dataset.txt
518,136
512
").as_deref(), Some("\u{1b}[3~")); assert_eq!(kitty("PageUp").as_deref(), Some("\u{1b}[5~")); assert_eq!(kitty("Ctrl PageDown").as_deref(), Some("\u{1b}[6;5~")); } #[test] fn lock_keys_are_not_reported() { assert_eq!( KeyWithModifier::new(BareKey::CapsLock).serialize_kit...
rust_dataset_chunk_518137
rust_dataset.txt
518,137
512
"), Some(LiveViewReleaseGesture { key: KeyWithModifier::new(BareKey::Esc), double: false, }) ); assert_eq!(LiveViewReleaseGesture::parse(""), None); assert_eq!(LiveViewReleaseGesture::parse("Esc Tab"), None); assert_eq!(LiveViewRele...
rust_dataset_chunk_518138
rust_dataset.txt
518,138
512
HiddenBars::All); assert_eq!(HiddenBars::None.union(&hidden_bars), hidden_bars); } #[test] fn hidden_bars_parse_from_a_comma_separated_list() { assert_eq!( "tab-bar,status-bar".parse::<HiddenBars>().unwrap(), HiddenBars::from_names(&[TAB_BAR, STATUS_BAR]) );...
rust_dataset_chunk_518139
rust_dataset.txt
518,139
512
, Result}; use windows::core::{GUID, HSTRING, PWSTR}; use windows::Win32::Foundation::PROPERTYKEY; use windows::Win32::System::Com::StructuredStorage::{PropVariantClear, PROPVARIANT}; use windows::Win32::System::Com::{ CoInitializeEx, CoTaskMemFree, CoUninitialize, COINIT_APARTMENTTHREADED, }; use windows::Win32::S...
rust_dataset_chunk_518140
rust_dataset.txt
518,140
512
unsafe { CoTaskMemFree(Some(text.0 as *const _)) }; result } --- FILE: zellij/zellij-utils/src/desktop_integration/desktop_entry.rs --- #[cfg(all(unix, not(target_os = "macos"), not(target_os = "android")))] pub(crate) mod xdg { use std::ffi::OsStr; use std::path::{Path, PathBuf}; use std::process...
rust_dataset_chunk_518141
rust_dataset.txt
518,141
512
text.as_bytes())?; let mut written_icons = vec![]; for (size, bytes) in icons() { let path = icon_path(data_home, size); write(&path, bytes)?; written_icons.push(path); } let removed = remove_old_launcher(data_home)?; Ok(Installed { ...
rust_dataset_chunk_518142
rust_dataset.txt
518,142
512
match std::fs::remove_file(path) { Ok(()) => { removed.push(path.to_path_buf()); Ok(()) }, Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), Err(e) => Err(e).with_context(|| format!("failed to remove {:?}", path)), } ...
rust_dataset_chunk_518143
rust_dataset.txt
518,143
512
=inbox;sessions;new-window;\n\ \n\ [Desktop Action inbox]\n\ Name=Show Inbox\n\ Exec={exec} window --inbox\n\ \n\ [Desktop Action sessions]\n\ Name=Show Sessions\n\ Exec={exec} window --sessions\n\ \n\ ...
rust_dataset_chunk_518144
rust_dataset.txt
518,144
512
\n\ Actions=inbox;sessions;new-window;\n\ \n\ [Desktop Action inbox]\n\ Name=Show Inbox\n\ Exec={exec} terminal --inbox\n\ \n\ [Desktop Action sessions]\n\ Name=Show Sessions\n\ Exec={exec} terminal --se...
rust_dataset_chunk_518145
rust_dataset.txt
518,145
512
("-q"), OsStr::new("-t"), OsStr::new("-f"), data_home.join("icons").join("hicolor").as_os_str(), ], ); } fn best_effort(program: &str, args: &[&OsStr]) { let outcome = Command::new(program) .args(args) .stdin(St...
rust_dataset_chunk_518146
rust_dataset.txt
518,146
512
() .join("applications") .join("dev.zellij.Zellij.desktop") ); assert_eq!( installed.icons, ["128x128", "256x256", "512x512"] .iter() .map(|size| dir .path() ...
rust_dataset_chunk_518147
rust_dataset.txt
518,147
512
.desktop"); std::fs::write(&shipped, SHIPPED_ASSET).unwrap(); for entry in [&installed.entry, &shipped] { let outcome = Command::new("desktop-file-validate").arg(entry).output(); match outcome { Ok(output) => assert!( ou...
rust_dataset_chunk_518148
rust_dataset.txt
518,148
512
!(decoy_entry.exists()); assert!(decoy_icon.exists()); } #[test] fn a_launcher_zellij_did_not_write_is_never_replaced_or_removed() { let dir = tempfile::TempDir::new().unwrap(); let entry = entry_path(dir.path()); write(&entry, b"[Desktop Entry]\n...
rust_dataset_chunk_518149
rust_dataset.txt
518,149
512
.path()).unwrap().is_empty()); } #[test] fn an_exec_path_needing_quotes_is_quoted_and_escaped() { assert_eq!( exec_argument("/opt/zellij/bin/zellij"), "/opt/zellij/bin/zellij" ); assert_eq!(exec_argument("/home/a b/zellij"), "\...
rust_dataset_chunk_518150
rust_dataset.txt
518,150
512
"), "zellij terminal"); assert_eq!(value(SHIPPED_ASSET, "TryExec"), "zellij"); } } } #[cfg(windows)] pub(crate) mod start_menu { use std::path::{Path, PathBuf}; use anyhow::{Context, Result}; use windows::core::{Interface, HSTRING}; use windows::Win32::Storage::EnhancedStorage:...
rust_dataset_chunk_518151
rust_dataset.txt
518,151
512
Ok(Some(path)), Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(None), Err(e) => Err(e).with_context(|| format!("failed to remove {:?}", path)), } } #[cfg(test)] mod tests { use super::*; use crate::desktop_integration::com::{get_string, Com}; ...
rust_dataset_chunk_518152
rust_dataset.txt
518,152
512
!(path, dir.path().join("Programs").join("Zellij.lnk")); let shortcut = read(&path); assert_eq!(shortcut.target, command.program.to_string_lossy()); assert_eq!(shortcut.arguments, ""); assert_eq!(shortcut.start_in, home.to_string_lossy()); assert_eq!( ...
rust_dataset_chunk_518153
rust_dataset.txt
518,153
512
PNG\r\n\x1a\n"; // 1024px, so the icon stays sharp at 512pt on Retina screens. const LARGE_ICON_PNG: &[u8] = include_bytes!("../../assets/icons/logo1024.png"); pub fn zellij() -> Result<Vec<u8>> { from_pngs(&[super::ICON_PNG, LARGE_ICON_PNG]) } pub fn from_pngs(pngs: &[&[u8]]) -> Result<Vec<u8>> { if pngs.is...
rust_dataset_chunk_518154
rust_dataset.txt
518,154
512
p6"), 128 => Some(b"ic07"), 256 => Some(b"ic08"), 512 => Some(b"ic09"), 1024 => Some(b"ic10"), _ => None, } } fn png_size(png: &[u8]) -> Result<(u32, u32)> { if png.len() < 24 || &png[..8] != PNG_SIGNATURE || &png[12..16] != b"IHDR" { bail!("the image does not be...
rust_dataset_chunk_518155
rust_dataset.txt
518,155
512
offset += length; } assert_eq!(offset, icns.len()); assert_eq!( seen, vec![ ("ic07".to_string(), ICON_PNG.to_vec()), ("ic10".to_string(), LARGE_ICON_PNG.to_vec()), ] ); } #[test] fn the_declared_size_of_eac...
rust_dataset_chunk_518156
rust_dataset.txt
518,156
512
ellij the app came from, we keep // the original's size and mtime in Info.plist. const SOURCE_LENGTH_KEY: &str = "ZellijSourceLength"; const SOURCE_MODIFIED_KEY: &str = "ZellijSourceModified"; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Installed { pub version: String, /// The zellij the app was made fro...
rust_dataset_chunk_518157
rust_dataset.txt
518,157
512
n == "Contents") && app.extension().is_some_and(|e| e == "app") } // Temporary names used while installing. They don't end in `.app`, so nothing mistakes them // for an app. fn staging_prefix() -> String { format!(".{}.installing-", bundle_name()) } fn replaced_prefix() -> String { format!(".{}.repla...
rust_dataset_chunk_518158
rust_dataset.txt
518,158
512
(&bundle)?; remove_leftovers(applications)?; if present { std::fs::remove_dir_all(&bundle) .with_context(|| format!("failed to remove {:?}", bundle))?; } Ok(present.then_some(bundle)) } pub fn installed(applications: &Path) -> Option<Installed> { let bundle = bundle_path(applica...
rust_dataset_chunk_518159
rust_dataset.txt
518,159
512
).with_context(|| format!("failed to write {:?}", path)) } // rename() can't replace a non-empty directory, so move the old app out of the way first, and // back again if the new one can't be moved in. fn swap(staging: &Path, bundle: &Path, replaced: &Path) -> Result<()> { let had_previous = match std::fs::rename(...
rust_dataset_chunk_518160
rust_dataset.txt
518,160
512
(value, _) = value.split_once("</string>")?; Some(value) } fn plist_number<T: std::str::FromStr + Default>(plist: &str, key: &str) -> T { plist_string(plist, key) .and_then(|value| value.parse().ok()) .unwrap_or_default() } // One install or removal at a time, so none deletes another's stagin...
rust_dataset_chunk_518161
rust_dataset.txt
518,161
512
//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleIdentifier</key> <string>{id}</string> <key>CFBundleName</key> <string>{name}</string> <key>CFBundleDisplayName</key> <string>{name}</string> <key>CFBundleExecutable</key> <st...
rust_dataset_chunk_518162
rust_dataset.txt
518,162
512
rc1`. fn build_version(version: &str) -> &str { version.split(['-', '+']).next().unwrap_or(version) } fn xml_escape(value: &str) -> String { let mut escaped = String::with_capacity(value.len()); for c in value.chars() { match c { '&' => escaped.push_str("&amp;"), '<' => esca...
rust_dataset_chunk_518163
rust_dataset.txt
518,163
512
std::fs::create_dir_all(dir.path().join("Applications")).unwrap(); Rig { dir, binary } } fn applications(&self) -> PathBuf { self.dir.path().join("Applications") } fn bundle(&self) -> PathBuf { bundle_path(&self.applications()) } ...
rust_dataset_chunk_518164
rust_dataset.txt
518,164
512
.join("Contents").join("Info.plist")).unwrap(); assert_eq!(plist_string(&plist, "CFBundleExecutable"), Some("zellij")); assert_eq!( plist_string(&plist, "CFBundleIdentifier"), Some(crate::distribution::app_id()) ); assert_eq!( plist_string(&plist, "CFB...
rust_dataset_chunk_518165
rust_dataset.txt
518,165
512
_dotted_numbers() { assert_eq!(build_version("0.46.0"), "0.46.0"); assert_eq!(build_version("0.46.0-rc.1"), "0.46.0"); assert_eq!(build_version("0.46.0+abc"), "0.46.0"); } #[test] fn the_binary_is_signed_before_the_bundle() { let rig = Rig::new(); let signed = RefCel...
rust_dataset_chunk_518166
rust_dataset.txt
518,166
512
!("codesign said no") }); assert!(result.is_err()); let binary = bundle.join("Contents").join("MacOS").join("zellij"); assert_eq!(std::fs::read(binary).unwrap(), b"first build"); assert_eq!( rig.entries(), vec![format!("{}.app", crate::distribution::displa...
rust_dataset_chunk_518167
rust_dataset.txt
518,167
512
unwrap(); } std::fs::create_dir_all(rig.applications().join(format!(".{name}.installing-x"))).unwrap(); rig.install().unwrap(); assert_eq!(rig.entries(), vec![format!(".{name}.installing-x"), name]); } #[test] fn installed_reports_the_version_and_binary_size() { let ...
rust_dataset_chunk_518168
rust_dataset.txt
518,168
512
.binary, slow_sign)); let second = scope.spawn(|| install(&rig.applications(), &rig.binary, slow_sign)); [first.join().unwrap(), second.join().unwrap()] }); for result in results { assert!(result.is_ok(), "{:?}", result); } assert_eq!(rig.entries(), ve...
rust_dataset_chunk_518169
rust_dataset.txt
518,169
512
.arg("-dv") .arg(&path) .output() .unwrap(); let details = String::from_utf8_lossy(&output.stderr); assert!( details.contains(&format!("Identifier={}\n", app_id())), "{:?}: {}", path, ...
rust_dataset_chunk_518170
rust_dataset.txt
518,170
512
(name: &str) -> String { format!( r"Software\Classes\AppUserModelId\{}", windows_app_id_for(name) ) } /// The image the app id's registry key points Windows at. pub fn windows_app_icon_path(cache_dir: &std::path::Path, name: &str) -> PathBuf { cache_dir.join(format!("{}.png", name)) } pub ...
rust_dataset_chunk_518171
rust_dataset.txt
518,171
512
.refused.push(text); } } } pub fn plan_setup(status: &Status, actions: SetupActions) -> SetupPlan { let mut plan = SetupPlan::default(); let installable = |item: &Item| { status.offered(*item) && !status.item(*item).map(|s| s.installed).unwrap_or(false) }; let entry_installable: Vec...
rust_dataset_chunk_518172
rust_dataset.txt
518,172
512
default \ terminal run that copy" .to_owned() }); } if actions.uninstall_desktop_entry { let removable: Vec<Item> = DESKTOP_ENTRY_ITEMS .into_iter() .filter(|item| status.removable(*item)) .collect(); let present =...
rust_dataset_chunk_518173
rust_dataset.txt
518,173
512
command finishes, fails or needs you. Choose \ which in Settings → Notifications." .to_owned(), ); lines.push( "Right-click Zellij's icon in the app menu or taskbar for Show Inbox and Show \ Sessions." .to_owned(), ); } ...
rust_dataset_chunk_518174
rust_dataset.txt
518,174
512
ItemStatus { pub item: Item, pub available: bool, pub installed: bool, pub changeable: bool, pub owner: Owner, pub state_text: String, pub hint: Option<String>, pub instructions: Vec<String>, #[serde(default)] pub upgrade: Option<Upgrade>, #[serde(default)] pub target: O...
rust_dataset_chunk_518175
rust_dataset.txt
518,175
512
{ Linux, Windows, MacOs, #[default] Other, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] pub struct Environment { pub platform: Platform, pub container: Option<String>, pub wsl: bool, pub package_manager: Option<String>, pub tiling_wm: bool, pub ...
rust_dataset_chunk_518176
rust_dataset.txt
518,176
512
Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub enum Flag { DesktopAppIntroduced, WelcomeCardShown, MissingServicesShown, WizardDismissed, ExitLineShown, RemindersOff, SetupApproved, SetupNeverShow, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum Reque...
rust_dataset_chunk_518177
rust_dataset.txt
518,177
512
)] pub struct WindowsRecord { pub start_menu: Option<PathBuf>, pub explorer_item: bool, pub jump_list: bool, /// The folder Zellij added to the user's PATH, so that only Zellij takes it away again. #[serde(default)] pub added_to_path: Option<PathBuf>, } #[derive(Debug, Clone, PartialEq, Eq, Ser...
rust_dataset_chunk_518178
rust_dataset.txt
518,178
512
return false; } self.missing_services = services.clone(); true }, Request::Status | Request::GetState | Request::Apply { .. } | Request::Repair(_) => { false }, } } } #[derive(Debug, Clon...
rust_dataset_chunk_518179
rust_dataset.txt
518,179
512
::new(()); pub fn update_at<T>( path: &Path, change: impl FnOnce(&mut IntegrationState) -> T, ) -> std::io::Result<T> { let _one_at_a_time = UPDATES.lock().unwrap_or_else(|e| e.into_inner()); let mut state = load_from(path); let before = state.clone(); let result...
rust_dataset_chunk_518180
rust_dataset.txt
518,180
512
line| format!("{}\n", line)) .collect() } pub fn has_marker(text: &str) -> bool { entry_values(text).get(MARKER_KEY).map(String::as_str) == Some("true") } pub fn marker_intact(text: &str) -> bool { has_marker(text) && entry_values(text).get(FINGERPRINT_KEY).map(...
rust_dataset_chunk_518181
rust_dataset.txt
518,181
512
OP_GLOBAL").or_else(|| var("ProgramData").map(|p| p.join("scoop"))), ]; WindowsInstallRoots { cargo_bin: cargo_home.map(|home| home.join("bin")), scoop: scoop.into_iter().flatten().collect(), chocolatey: var("ChocolateyInstall") ...
rust_dataset_chunk_518182
rust_dataset.txt
518,182
512
brew_prefix: Option<&Path>) -> Option<String> { if canonical.starts_with("/nix/store") { return Some("Nix".to_owned()); } if canonical.starts_with("/home/linuxbrew/.linuxbrew") { return Some("Homebrew".to_owned()); } if let Some(prefix) = homebrew_prefix.f...
rust_dataset_chunk_518183
rust_dataset.txt
518,183
512
-> bool { std::env::var_os("PATH") .map(|path| { std::env::split_paths(&path).any(|entry| entry == dir || same_file(&entry, dir)) }) .unwrap_or(false) } pub fn started_from() -> Option<PathBuf> { let argv0 = std::env::args_os().next()?; ...
rust_dataset_chunk_518184
rust_dataset.txt
518,184
512
, PartialEq, Eq)] pub enum Place { Downloads, Temporary, Removable, Elsewhere, } pub fn temporary_dirs() -> Vec<PathBuf> { let mut dirs = vec![PathBuf::from("/tmp"), PathBuf::from("/var/tmp")]; if let Some(tmpdir) = std::env::var_os("TMPDIR") { di...
rust_dataset_chunk_518185
rust_dataset.txt
518,185
512
running from your Downloads folder.".to_owned(), Place::Temporary => { "Zellij is running from a temporary folder that may be emptied.".to_owned() }, Place::Removable => "Zellij is running from a removable drive.".to_owned(), Place::Elsewhere => "This cop...
rust_dataset_chunk_518186
rust_dataset.txt
518,186
512
{ let dirs = std::env::var_os("XDG_DATA_DIRS") .filter(|dirs| !dirs.is_empty()) .unwrap_or_else(|| "/usr/local/share:/usr/share".into()); std::env::split_paths(&dirs).collect() } pub fn system_launcher() -> Option<PathBuf> { system_data_dirs() .into_...
rust_dataset_chunk_518187
rust_dataset.txt
518,187
512
Name=Mine"); assert!(has_marker(&edited)); assert!(!marker_intact(&edited)); assert!(!marker_intact(body)); } #[test] fn package_manager_paths_are_recognised() { for (path, expected) in [ ("/nix/store/abc-zellij/bin/zellij", Some("...
rust_dataset_chunk_518188
rust_dataset.txt
518,188
512
), (r"C:\Users\me\Downloads\zellij.exe", None), (r"C:\Program Files\Zellij\zellij.exe", None), ] { assert_eq!( windows_package_manager_for(Path::new(path), &roots).as_deref(), expected, ...
rust_dataset_chunk_518189
rust_dataset.txt
518,189
512
); } #[test] fn the_repair_prompt_needs_every_condition() { let dir = tempfile::tempdir().unwrap(); let running = dir.path().join("zellij"); std::fs::write(&running, b"binary").unwrap(); let missing = dir.path().join("moved").join("zellij"); ...
rust_dataset_chunk_518190
rust_dataset.txt
518,190
512
).unwrap(); assert_eq!( stable_binary_path_from(&store, Some(&profile), &[]), if cfg!(unix) { profile.clone() } else { store.clone() } ); assert_eq!(stable_binary_path_from(&store,...
rust_dataset_chunk_518191
rust_dataset.txt
518,191
512
); assert!(state.has(Flag::ExitLineShown)); assert!(state.launcher.is_none()); } #[test] fn concurrent_updates_do_not_overwrite_each_other() { let dir = tempfile::tempdir().unwrap(); let path = dir.path().join(STATE_FILE_NAME); let handles: Vec<_> = [ Req...
rust_dataset_chunk_518192
rust_dataset.txt
518,192
512
} #[test] fn the_desktop_tip_follows_an_escaped_wizard_only_while_tips_are_on() { let mut state = IntegrationState::default(); assert!(!state.should_offer_desktop_tip(&context())); state.set(Flag::WizardDismissed); assert!(state.should_offer_desktop_tip(&context())); ...
rust_dataset_chunk_518193
rust_dataset.txt
518,193
512
_refusal_names_the_reason_of_the_start_menu_items() { let off = "Turned off by ZELLIJ_DESKTOP_INTEGRATION"; let mut status = status_with(vec![ ItemStatus::unavailable(Item::Launcher, "Linux only"), ItemStatus::unavailable(Item::StartMenu, off), ItemStatus::unavailable...
rust_dataset_chunk_518194
rust_dataset.txt
518,194
512
); assert!(plan.remove.is_empty()); assert_eq!(plan.refused.len(), 1); } #[test] fn an_entry_of_ours_with_an_update_waiting_can_still_be_removed() { let out_of_date = ItemStatus { installed: false, ..ours(Item::Launcher) } .with_upgrade(Upgrad...
rust_dataset_chunk_518195
rust_dataset.txt
518,195
512
(&a, &dir.path().join("missing"))); } #[test] fn versions_are_read_from_the_version_output() { assert_eq!(version_number("zellij 0.43.1"), Some(vec![0, 43, 1])); assert_eq!(version_number("0.45.0-dev"), Some(vec![0, 45, 0])); assert!(version_number("zellij 0.44.0") < version_number(...
rust_dataset_chunk_518196
rust_dataset.txt
518,196
512
_os = "macos"), not(target_os = "android")) )))] use unsupported as platform; #[cfg(windows)] use windows_desktop as platform; pub fn handle(request: &str) -> String { let response = match Request::from_json(request) { Err(e) => Response::Error(format!("The request could not be read: {}", e)), Ok(R...
rust_dataset_chunk_518197
rust_dataset.txt
518,197
512
{ [ Item::CopyBinary, Item::Launcher, Item::StartMenu, Item::DefaultTerminal, Item::ExplorerItem, ] .into_iter() .filter(|item| items.contains(item)) .collect() } fn removal_order(items: &[Item]) -> Vec<Item> { [ Item::DefaultTerminal, It...
rust_dataset_chunk_518198
rust_dataset.txt
518,198
512
!(target_os = "macos") { Platform::MacOs } else if cfg!(target_os = "linux") || cfg!(target_family = "unix") { Platform::Linux } else { Platform::Other }, desktop: std::env::var("XDG_CURRENT_DESKTOP") .ok() .filter(|d| !d.is_emp...
rust_dataset_chunk_518199
rust_dataset.txt
518,199
512
Permanent(String), Copied, Update(crate::desktop_integration::Upgrade), Occupied, Fresh, } pub fn permanent_reason(environment: &Environment) -> Option<String> { let running = environment.binary.as_deref()?; if let Some(manager) = &environment.package_manager { return Some(format!("Ins...