text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>ing, ClientChannels>, pub client_read_only_status: HashMap<String, bool>, pub client_session_token_hash: HashMap<String, String>, } #[derive(Debug, Clone)] pub struct ClientChannels { pub os_api: Box<dyn ClientOsApi>, pub control_channel_tx: Option<UnboundedSender<Message>>, pub termi...
fim
zellij-org/zellij
rust
<|fim_prefix|>use axum::http::Request; use axum_extra::extract::cookie::Cookie; use std::collections::HashMap; use std::net::IpAddr; pub fn get_mime_type(ext: Option<&str>) -> &str { match ext { None => "text/plain", Some(ext) => match ext { "html" => "text/html", "css" => "...
fim
zellij-org/zellij
rust
<|fim_suffix|>.unwrap_or(false); let _ = attachment_complete_rx.await; let mut mouse_old_event = MouseEvent::new(); // Per-connection parser state. Hoisted so a CSI / Kitty sequence // split across two WebSocket frames resolves on the second frame. let mut stdin_session = StdinSession::new(explici...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[allow(unused_imports)] // some imports used only with web_server_capability feature use zellij_utils::consts::{ session_info_cache_file_name, session_info_folder_for_session, session_layout_cache_file_name, VERSION, ZELLIJ_SESSION_INFO_CACHE_DIR, ZELLIJ_SOCK_DIR, }; #[allow(unused_imports)] use ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use once_cell::sync::OnceCell; use tokio::runtime::Runtime; // Global tokio run<|fim_suffix|>me") }) } <|fim_middle|>time for async I/O operations // Shared between plugin downloads, timers, and action completion tracking static TOKIO_RUNTIME: OnceCell<Runtime> = OnceCell::new(); pub fn get_tokio_ru...
fim
zellij-org/zellij
rust
<|fim_suffix|>"\x1b]4;5;?\x07", ); assert_eq!( HostQuery::PaletteRegister { index: 255, terminator: OscTerminator::St, } .to_query_bytes(), b"\x1b]4;255;?\x1b\\", ); } #[test] fn from_bell_terminated_map...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[cfg(not(windows))] #[path = "os_input_output_unix.rs"] mod os_input_output_unix; #[cfg(windows)] #[path = "os_input_output_windows.rs"] mod os_input_output_windows; pub mod host_query; pub mod os_input_output; pub mod output; pub mod panes; pub mod tab; pub mod background_jobs; mod global_async_runtim...
fim
zellij-org/zellij
rust
use std::{collections::VecDeque, io::Write}; use crate::plugins::PluginId; use log::{debug, error}; use zellij_utils::errors::prelude::*; use serde::{Deserialize, Serialize}; // 16kB log buffer const ZELLIJ_MAX_PIPE_BUFFER_SIZE: usize = 16_384; #[derive(Debug, Serialize, Deserialize)] pub struct LoggingPipe { bu...
fim
zellij-org/zellij
rust
<|fim_suffix|> PaneId::Terminal(13), embedded_size(), &mut tabs, ); let mut cleared = state.clear_fits_owned_by(CLIENT_A, &mut tabs); cleared.sort_unstable(); assert_eq!(cleared, vec![1, 2]); assert!(!state.has_fit(1)); assert!(!state.has_fit(...
fim
zellij-org/zellij
rust
<|fim_suffix|>String>> { let mut system_info = System::new(); let refresh_kind = ProcessRefreshKind::nothing().with_cmd(UpdateKind::Always); system_info.refresh_processes_specifics(ProcessesToUpdate::All, true, refresh_kind); let mut cmds = HashMap::new(); for (_pid, process) in ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::os_input_output::{command_exists, AsyncReader}; use crate::panes::PaneId; use nix::{ fcntl::{fcntl, FcntlArg, OFlag}, pty::{openpty, OpenptyResult, Winsize}, sys::{ signal::{kill, Signal}, termios, }, unistd, }; use tokio::io::unix::AsyncFd; use libc::{self...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::os_input_output::{resolve_command, AsyncReader}; use crate::panes::PaneId; use std::{ collections::BTreeMap, ffi::OsStr, io, os::windows::ffi::OsStrExt, os::windows::io::{FromRawHandle, IntoRawHandle, OwnedHandle}, sync::{ atomic::{AtomicU32, AtomicU64, Ordering...
fim
zellij-org/zellij
rust
<|fim_suffix|>ged_chunks } } fn extract_characters_from_row( &self, row: &Row, viewport_width: usize, ) -> Vec<TerminalCharacter> { let mut terminal_characters: Vec<TerminalCharacter> = row.columns.iter().cloned().collect(); // pad row let row_width = ...
fim
zellij-org/zellij
rust
<|fim_prefix|>m<|fim_suffix|>t_tests; <|fim_middle|>od outpu<|endoftext|>
fim
zellij-org/zellij
rust
use super::super::{CharacterChunk, FloatingPanesStack, Output, OutputBuffer, SixelImageChunk}; use crate::panes::sixel::SixelImageStore; use crate::panes::terminal_character::AnsiCode; use crate::panes::{LinkHandler, Row, TerminalCharacter}; use crate::ClientId; use std::cell::RefCell; use std::collections::{HashSet, V...
fim
zellij-org/zellij
rust
<|fim_suffix|>pane_ids { assert!(result.contains(&pane_id)); } } #[test] fn clear_pane_group_clears_existing_group() { let mut pane_groups = create_test_pane_groups(); let client_id: ClientId = 1; let pane_ids = vec![ PaneId::Terminal(10), ...
fim
zellij-org/zellij
rust
use crate::tab::Pane; use crate::{os_input_output::ServerOsApi, panes::PaneId, ClientId}; use std::collections::{BTreeMap, HashMap, HashSet}; #[derive(Clone)] pub struct ActivePanes { active_panes: HashMap<ClientId, PaneId>, shadow_clients: HashSet<ClientId>, os_api: Box<dyn ServerOsApi>, } impl std::fmt...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::panes::AnsiCode; use std::convert::TryFrom; pub fn parse_sgr_color(params: &mut dyn Iterator<Item = u16>) -> Option<AnsiCode> { match params.next() { Some(2) => Some(AnsiCode::RgbCode(( u8::try_from(params.next()?).ok()?, u8::try_from(params.next()?).ok()?, ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::tab::{MIN_TERMINAL_HEIGHT, MIN_TERMINAL_WIDTH}; use crate::{panes::PaneId, tab::Pane}; use std::cmp::Ordering; use std::collections::HashMap; use zellij_utils::data::{Direction, ResizeStrategy}; use zellij_utils::errors::prelude::*; use zellij_utils::pane_size::{Dimension, PaneGeom, Size, Viewp...
fim
zellij-org/zellij
rust
<|fim_suffix|>output: &mut Output, mouse_hover_pane_id: &HashMap<ClientId, PaneId>, current_pane_group: HashMap<ClientId, Vec<PaneId>>, client_id_override: Option<ClientId>, help_text_visible: &HashMap<ClientId, bool>, ) -> Result<()> { let err_context = || "failed to render ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::panes::grid::Row; use crate::panes::link_handler::LinkHandler; use crate::panes::terminal_character::{Cursor, LinkAnchor}; use std::collections::VecDeque; #[derive(Debug, Clone)] struct DetectedLink { url: String, start_position: HyperlinkPosition, end_position: HyperlinkPosition, ...
fim
zellij-org/zellij
rust
use std::collections::HashMap; use super::LinkAnchor; const TERMINATOR: &str = "\u{1b}\\"; #[derive(Debug, Clone)] pub struct LinkHandler { links: HashMap<u16, Link>, link_index: u16, } #[derive(Debug, Clone)] pub struct Link { pub id: Option<String>, pub uri: String, } impl LinkHandler { pub fn...
fim
zellij-org/zellij
rust
<|fim_suffix|>erminal_pane; mod tiled_panes; pub use active_panes::*; pub use alacritty_functions::*; pub use floating_panes::*; pub use grid::*; pub use link_handler::*; pub(crate) use plugin_pane::*; pub use selection::Selection; pub use sixel::*; pub(crate) use terminal_character::*; pub use terminal_pane::*; pub u...
fim
zellij-org/zellij
rust
<|fim_suffix|> .iter() .map(|p| p.to_string()) .collect::<Vec<_>>() .join(", ") ), bold_white.paint("Allow?"), green.paint("(y/n)"), )); } messages } } <|fim_prefix...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::Selection; use crate::panes::terminal_character::TerminalCharacter; use crate::panes::{Grid, Row}; use std::borrow::Cow; use std::collections::VecDeque; use std::fmt::Debug; use zellij_utils::input::actions::SearchDirection; use zellij_utils::position::Position; // If char is neither alphanume...
fim
zellij-org/zellij
rust
<|fim_suffix|>d = word_end; } else { let word_end_is_to_the_left_of_last_word_start = self .last_added_word_position .map(|(l_start, _l_end)| word_end.column <= l_start.column) .unwrap_or(false); let word_start_is_to_the_right_of_last_word_...
fim
zellij-org/zellij
rust
<|fim_suffix|> serialized_image.clone(), ); serialized_image } }) } pub fn image_count(&self) -> usize { self.sixel_images.len() } } <|fim_prefix|>use crate::output::SixelImageChunk; use std::cell::RefCell; use std:...
fim
zellij-org/zellij
rust
<|fim_suffix|> let controls_line_length = controls_bare_text_first_part.len() + enter_bare_text.len() + controls_bare_text_second_part.len() + esc_bare_text.len() + controls_bare_text_third_part.len() + ctrl_c_bare_text.len() ...
fim
zellij-org/zellij
rust
<|fim_suffix|>e_name(&mut self) { if self.pane_name != self.prev_pane_name { self.prev_pane_name = self.pane_name.clone() } } fn load_pane_name(&mut self) { if self.pane_name != self.prev_pane_name { self.pane_name = self.prev_pane_name.clone() } } ...
fim
zellij-org/zellij
rust
<|fim_suffix|>pan.pos, rows: span.size, ..current_geom }, }; StackedPanes::new(self.panes.clone()).resize_panes_in_stack(&span.pid, new_geom)?; if new_geom.rows.as_usize() != current_geom.rows.as_usize() ...
fim
zellij-org/zellij
rust
<|fim_suffix|>stacked()) .map(|(p_id, _p)| *p_id) .collect() }; for pane_id in pane_ids_in_stacks { if !seen.contains(&pane_id) { let mut current_pane_is_above_stack = true; let positions_in_stack = self.positions_in_stack(&pane...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::is_inside_viewport; use super::pane_resizer::PaneResizer; use super::stacked_panes::StackedPanes; use crate::tab::{MIN_TERMINAL_HEIGHT, MIN_TERMINAL_WIDTH}; use crate::{panes::PaneId, tab::Pane}; use std::cmp::{Ordering, Reverse}; use std::collections::{HashMap, HashSet}; use zellij_utils::data...
fim
zellij-org/zellij
rust
<|fim_suffix|> } fn get_content_rows(&self) -> usize { unimplemented!() } fn reset_size_and_position_override(&mut self) { unimplemented!() } fn set_geom(&mut self, position_and_size: PaneGeom) { self.pane_geom = position_and_size; } fn set_geom_override(&mut self, _p...
fim
zellij-org/zellij
rust
use super::super::TerminalPane; use crate::panes::sixel::SixelImageStore; use crate::panes::LinkHandler; use crate::tab::Pane; use insta::assert_snapshot; use std::cell::RefCell; use std::collections::HashMap; use std::rc::Rc; use zellij_utils::data::{Palette, Style}; use zellij_utils::pane_size::PaneGeom; fn read_fix...
fim
zellij-org/zellij
rust
<|fim_suffix|>ew(21, 6); selection.add_word_to_position(word_start, word_end); assert_eq!(selection.start, selection_start); assert_eq!(selection.end, word_end); } #[test] fn add_word_to_position_reduce_from_above() { let selection_start = Position::new(10, 10); let selection_end = Position::new(2...
fim
zellij-org/zellij
rust
<|fim_suffix|>unwrap(); let pane_sixel_content = read_fixture("sixel-image-500px.six"); terminal_pane.handle_pty_bytes(pane_sixel_content.clone()); // one image above text terminal_pane.handle_pty_bytes(text_to_fill_pane.into_bytes()); terminal_pane.handle_pty_bytes(pane_sixel_content); // one image bel...
fim
zellij-org/zellij
rust
<|fim_prefix|>mod pinned_executor; mod pipes; mod plugin_loader; mod plugin_map; mod plugin_worker; mod wasm_bridge; mod watch_filesystem; mod zellij_exports; use log::info; pub use pinned_executor::PinnedExecutor; use std::{ collections::{BTreeMap, HashMap, HashSet}, fs, path::PathBuf, time::Duration,...
fim
zellij-org/zellij
rust
<|fim_suffix|> pub fn thread_count(&self) -> usize { self.execution_threads .lock() .unwrap() .iter() .filter(|t| t.is_some()) .count() } } impl Drop for PinnedExecutor { fn drop(&mut self) { let mut threads = self.execution_threads....
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::{PluginId, PluginInstruction}; use crate::plugins::plugin_map::RunningPlugin; use crate::plugins::wasm_bridge::PluginRenderAsset; use crate::plugins::zellij_exports::{wasi_read_string, wasi_write_object}; use std::collections::{HashMap, HashSet}; use zellij_utils::data::{PipeMessage, PipeSource...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::plugins::plugin_map::{ PluginEnv, PluginMap, RunningPlugin, VecDequeInputStream, WriteOutputStream, }; use crate::plugins::plugin_worker::{plugin_worker, RunningWorker}; use crate::plugins::wasm_bridge::{LoadingContext, PluginCache}; use crate::plugins::zellij_exports::{wasi_write_object, z...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::plugins::plugin_worker::MessageToWorker; use crate::plugins::PluginId; use std::io::Write; use std::{ collections::{BTreeMap, HashMap, HashSet, VecDeque}, path::PathBuf, sync::{Arc, Mutex}, }; use wasmi::{Instance, Store, StoreLimits}; use wasmi_wasi::WasiCtx; use crate::{thread_bu...
fim
zellij-org/zellij
rust
<|fim_suffix|>{ let (sender, mut receiver): ( UnboundedSender<MessageToWorker>, UnboundedReceiver<MessageToWorker>, ) = unbounded_channel(); crate::global_async_runtime::get_tokio_runtime().spawn({ async move { loop { match receiver.recv().await { ...
fim
zellij-org/zellij
rust
<|fim_prefix|>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, PipeStateChange, }; use crate::plugins::plugin_loader::PluginLoader; use crate::plugins::plu...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::PluginInstruction; use std::path::PathBuf; use crate::thread_bus::ThreadSenders; use std::path::Path; use std::time::Duration; use notify_debouncer_full::{ new_debouncer, notify::{EventKind, RecommendedWatcher, RecursiveMode, Watcher}, DebounceEventResult, Debouncer, FileIdMap, };...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::collections::{HashMap, VecDeque}; use std::time::Duration; use zellij_utils::channels; use zellij_utils::errors::{prelude::*, ContextType, PtyWriteContext}; use crate::route::NotificationEnd; use crate::thread_bus::Bus; // we separate these instruction to a different thread because some progra...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::panes::PaneId; use crate::ClientId; use std::collections::{BTreeMap, HashMap}; use std::path::PathBuf; use std::time::{SystemTime, UNIX_EPOCH}; use zellij_utils::common_path::common_path_all; use zellij_utils::pane_size::PaneGeom; use zellij_utils::{ data::{LayoutMetadata, PaneMetadata, Tab...
fim
zellij-org/zellij
rust
<|fim_suffix|>]52;{};{}\u{1b}\\", dest, base64::encode(content)), ); }, }; Ok(()) } pub(crate) fn as_copy_destination(&self) -> CopyDestination { match self { ClipboardProvider::Command(_) => CopyDestination::Command, ClipboardProvider...
fim
zellij-org/zellij
rust
<|fim_suffix|>{} stdin", self.command))?; // reap process with a 1 second timeout std::thread::spawn(move || { let timeout = std::time::Duration::from_secs(1); let start = std::time::Instant::now(); loop { match process.try_wait() { ...
fim
zellij-org/zellij
rust
<|fim_suffix|> &mut positions_left_without_exact_matches, )?; // we do this because we have to add the remaining tiled pane ids ONLY AFTER positioning // the new panes, otherwise the layout might get borked let mut pane_applier = PaneApplier::new( &mut self.tiled_panes, ...
fim
zellij-org/zellij
rust
<|fim_suffix|> event: *event, }); } else { return Ok(MouseAction::FocusPane { pane_id: details.pane_id, position: event.position, }); } } if event.right { let Some(pan...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::panes::{FloatingPanes, TiledPanes}; use std::cell::RefCell; use std::collections::BTreeMap; use std::rc::Rc; use zellij_utils::{ input::layout::{ FloatingPaneLayout, LayoutConstraint, SwapFloatingLayout, SwapTiledLayout, TiledPaneLayout, }, pane_size::{PaneGeom, Size}, }; #...
fim
zellij-org/zellij
rust
<|fim_suffix|> } } <|fim_prefix|>use crate::{os_input_output::AsyncReader, screen::ScreenInstruction, thread_bus::ThreadSenders}; use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, }; use std::time::{Duration, Instant}; use tokio::task; use zellij_utils::{ errors::{get_current_ctx, prelude::*, ContextTy...
fim
zellij-org/zellij
rust
<|fim_prefix|>//! Definitions and helpers for sending and receiving messages between threads. use crate::{ background_jobs::BackgroundJob, os_input_output::ServerOsApi, plugins::PluginInstruction, pty::PtyInstruction, pty_writer::PtyWriteInstruction, screen::ScreenInstruction, ServerInstruction, }; use zel...
fim
zellij-org/zellij
rust
<|fim_suffix|> (BOTTOM_RIGHT, VERTICAL_LEFT) => { // (┘, ┤) => Some(┤) let boundary_type = VERTICAL_LEFT; Some(BoundarySymbol { boundary_type, invisible, color, }) }, (BOTTOM_RIGHT, VERTICAL_RIGHT) | ...
fim
zellij-org/zellij
rust
<|fim_suffix|>rdinates>) -> bool { if let Some(max_height) = component_coordinates.as_ref().and_then(|p| p.height) { if current_height > max_height { return true; } } false } <|fim_prefix|>use std::fmt::{self, Display, Formatter}; #[derive(Debug, Clone)] pub struct Coordinates {...
fim
zellij-org/zellij
rust
<|fim_prefix|>mod component_coordinates; mod nested_list; mod ribbon; mod table; mod text; use crate::panes::grid::Grid; use lazy_static::lazy_static; use regex::Regex; use vte; use zellij_utils::data::Style; use zellij_utils::errors::prelude::*; use component_coordinates::{is_too_high, is_too_wide, Coordinates}; use...
fim
zellij-org/zellij
rust
<|fim_suffix|>th_of_longest_line = 0; for line_item in contents.iter() { let mut line_item_text_width = 0; for character in line_item.text.text.chars() { let character_width = character.width().unwrap_or(0); line_item_text_width += character_width; } let bulle...
fim
zellij-org/zellij
rust
<|fim_suffix|> &declaration, &colors, text_style, ); let mut stringified = component_coordinates .map(|c| c.to_string()) .unwrap_or_else(|| String::new()); stringified.push_str(&format!( "{}{}{}{} {} {}{}{}", RESET_STYLES, first_arrow_styles, ...
fim
zellij-org/zellij
rust
<|fim_suffix|>ngify_table_rows( stringified_columns: BTreeMap<usize, Vec<Text>>, coordinates: &Option<Coordinates>, ) -> BTreeMap<usize, Vec<Text>> { let mut stringified_rows: BTreeMap<usize, Vec<Text>> = BTreeMap::new(); let mut row_width = 0; for (_, column) in stringified_columns.into_iter() { ...
fim
zellij-org/zellij
rust
<|fim_suffix|>ground // style will apply the whole length of the coordinates stringified.push_str(&format!( "{:width$}", " ", width = background_padding_length )); } text_width += backgrou...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::fmt::{Display, Error, Formatter}; use std::time::Instant; use zellij_utils::{ data::{PaletteColor, Styling}, errors::prelude::*, }; #[derive(Debug, Clone, Default)] pub struct LoadingIndication { pub ended: bool, error: Option<String>, animation_offset: usize, plugin_nam...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub mod boundaries; pub mod compone<|fim_suffix|>pub mod pane_boundaries_frame; pub mod pane_contents_and_ui; <|fim_middle|>nts; pub mod loading_indication; <|endoftext|>
fim
zellij-org/zellij
rust
<|fim_suffix|> y_coords_of_title, )); } else { for row in 0..self.geom.rows { if row == 0 { // top row let title = self.render_title().with_context(err_context)?; let x = self.geom.x; ...
fim
zellij-org/zellij
rust
<|fim_prefix|>use crate::output::Output; use crate::panes::PaneId; use crate::tab::Pane; use crate::ui::boundaries::Boundaries; use crate::ui::pane_boundaries_frame::FrameParams; use crate::ClientId; use std::collections::{HashMap, HashSet}; use zellij_utils::data::{client_id_to_colors, InputMode, PaletteColor, Style};...
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::*; use zellij_utils::input::command::RunCommand; fn make_server() -> ServerOsInputOutput { get_server_os_input().expect("failed to create server os input") } // --- Cross-platform command helpers --- #[allow(dead_code)] #[cfg(not(windows))] fn long_running_cmd() -> Command { let mut ...
fim
zellij-org/zellij
rust
<|fim_suffix|>:Terminal(1)); assert_eq!(events[0].1, vec!["vim", "file.rs"]); assert!(events[0].2, "expected is_foreground=true"); } #[test] fn empty_foreground_falls_back_to_shell_command() { let mock = MockOsApi::new(); let child_pid = 100; mock.set_cmd(child_pid, vec!["/bin/bash".into()]); l...
fim
zellij-org/zellij
rust
<|fim_suffix|>teInstruction::Write(b"good data".to_vec(), 2, None), ], ); // Terminal 2 should have received its bytes despite terminal 1 being stuck let written_2 = mock_clone.get_written_bytes(2); assert_eq!(written_2, b"good data"); // Terminal 1 data is lost (stuck until Exit, then dro...
fim
zellij-org/zellij
rust
<|fim_suffix|>stdin() .unwrap(); let protobuf_message: ProtobufMessage = ProtobufMessage::decode(protobuf_bytes.as_slice()) .unwrap(); let message = protobuf_message.name; let payload = protobuf_message.payload; $worker_static_name.with(|wo...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub use crate::shim::*; pub use crate::*; pub use zellij_utils::consts::VERSION; pub use zellij_utils::data::*; pub use zellij<|fim_suffix|> zellij_utils::input::actions; pub use zellij_utils::pane_size::Size; <|fim_middle|>_utils::errors::prelude::*; pub use<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_prefix|>mod nested_list; mod ribbon; mod table; mod text; pub use prost::{self, *}; pub use zellij_utils::plugin_api; p<|fim_suffix|> pub use ribbon::*; pub use table::*; pub use text::*; <|fim_middle|>ub use nested_list::*;<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_prefix|>use super::Text; use std::borrow::Borrow; use std::ops::RangeBounds; #[derive(Debug, Default, Clone)] pub struct NestedListItem { indentation_level: usize, content: Text, } impl NestedListItem { pub fn new<S: AsRef<str>>(text: S) -> Self where S: ToString, { NestedLis...
fim
zellij-org/zellij
rust
<|fim_suffix|>ons)); result } <|fim_prefix|>use super::Text; use std::borrow::Borrow; pub fn print_ribbon(text: Text) { print!("\u{1b}Pzribbon;{}\u{1b}\\", text.serialize()); } pub fn print_ribbon_with_coordinates( text: Text, x: usize, y: usize, width: Option<usize>, height: Option<usize>...
fim
zellij-org/zellij
rust
use super::Text; /// render a table with arbitrary data #[derive(Debug, Clone)] pub struct Table { contents: Vec<Vec<Text>>, } impl Table { pub fn new() -> Self { Table { contents: vec![] } } pub fn add_row(mut self, row: Vec<impl ToString>) -> Self { self.contents .push(ro...
fim
zellij-org/zellij
rust
<|fim_prefix|>use std::ops::Bound; use std::ops::RangeBounds; #[derive(Debug, Default, Clone)] pub struct Text { text: String, selected: bool, opaque: bool, indices: Vec<Vec<usize>>, } impl Text { pub fn new<S: AsRef<str>>(content: S) -> Self where S: ToString, { Text { ...
fim
zellij-org/zellij
rust
<|fim_suffix|>cro_rules! style { ($fg:expr, $bg:expr) => { ansi_term::Style::new() .fg(match $fg { PaletteColor::Rgb((r, g, b)) => ansi_term::Color::RGB(r, g, b), PaletteColor::EightBit(color) => ansi_term::Color::Fixed(color), }) .on(match...
fim
zellij-org/zellij
rust
<|fim_suffix|> "LaunchOrFocusPlugin" => Some(Self::LaunchOrFocusPlugin), "LeftMouseRelease" => Some(Self::LeftMouseRelease), "RightMouseRelease" => Some(Self::RightMouseRelease), "MiddleMouseRelease" => Some(Self::MiddleMouseRelease), "SearchInput" => Some(Self::SearchIn...
fim
zellij-org/zellij
rust
<|fim_suffix|>ring::String>, #[prost(string, optional, tag="3")] pub cwd: ::core::option::Option<::prost::alloc::string::String>, } <|fim_prefix|>#[allow(clipp<|fim_middle|>y::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Command { #[prost(string, tag="1")] pub ...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventNameList { #[prost(enumeration="EventType", repeated, tag="1")] pub event_types: ::prost::alloc::vec::Vec<i32>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, :...
fim
zellij-org/zellij
rust
<|fim_suffix|>ing, #[prost(int32, optional, tag="2")] pub line_number: ::core::option::Option<i32>, #[prost(string, optional, tag="3")] pub cwd: ::core::option::Option<::prost::alloc::string::String>, } <|fim_prefix|>#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Mess...
fim
zellij-org/zellij
rust
#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InputModeMessage { #[prost(enumeration="InputMode", tag="1")] pub input_mode: i32, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum InputMode {...
fim
zellij-org/zellij
rust
<|fim_suffix|> /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { NamedKey::PageDown => "PageDown", NamedKey::PageUp => "PageUp", NamedKey::LeftArrow => "LeftArr...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::<|fim_suffix|>rost(string, optional, tag="3")] pub worker_name: ::core::option::Option<::prost::alloc::string::String>, } <|fim_middle|>prost::Message)] pub struct Message { #[prost(string, tag="1")] pub name: ::prost:...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PipeMessage { #[prost(enumeration="PipeSource", tag="1")] pub source: i32, #[prost(string, optional, tag="2")] pub cli_source_id: ::core::option::Option<::prost::alloc::string::String>, ...
fim
zellij-org/zellij
rust
<|fim_suffix|>g, #[prost(uint32, tag="4")] pub client_id: u32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ZellijVersion { #[prost(string, tag="1")] pub version: ::prost::alloc::string::String, } <|fim_prefix|>#[allow(clippy::derive_partial_e...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Permiss<|fim_suffix|>riables", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { ...
fim
zellij-org/zellij
rust
<|fim_suffix|>[repr(i32)] pub enum ResizeAction { Increase = 0, Decrease = 1, } impl ResizeAction { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not ...
fim
zellij-org/zellij
rust
<|fim_prefix|>#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Style { #[deprecated] #[prost(message, optional, tag="1")] pub palette: ::core::option::Option<Palette>, #[<|fim_suffix|>ion<Color>, #[prost(message, optional, tag="17")] pub pin...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub mod api { pub mod action { include!("api.action.rs"); } pub mod command { include!("api.command.rs"); } pub mod event { include!("api.event.rs"); } pub mod file { include!("api.file.rs"); } pub mod input_mode { include!("api.i...
fim
zellij-org/zellij
rust
<|fim_prefix|>pub mod client_server_contract { include!<|fim_suffix|>er_contract.rs"); } <|fim_middle|>("client_serv<|endoftext|>
fim
zellij-org/zellij
rust
pub mod web_server_contract { include!("web_server_contract.rs"); } <|endoftext|>
fim
zellij-org/zellij
rust
<|fim_suffix|> #[prost(uint32, tag="3")] pub port: u32, } <|fim_prefix|>#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InstructionForWebServer { #[prost(oneof="instruction_for_web_server::Instruction", tags="1, 2")] pub instruction: ::core::option:...
fim
zellij-org/zellij
rust
<|fim_prefix|>//! Definitions and helpers for sending and receiving messages between threads. use std::cell::RefCell; use crate::errors::{get_current_ctx, ErrorContext}; pub use crossbeam::channel::{ bounded, unbounded, Receiver, RecvError, RecvTimeoutError, Select, SendError, Sender, TrySendError, }; /// An...
fim
zellij-org/zellij
rust
<|fim_suffix|> #[clap(long, value_parser)] configuration: Option<PluginUserConfiguration>, #[clap(long, value_parser)] skip_plugin_cache: bool, /// The x coordinates if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(short, long, requires("float...
fim
zellij-org/zellij
rust
<|fim_prefix|>include!(concat!( env<|fim_suffix|>); <|fim_middle|>!("CARGO_MANIFEST_DIR"), "/assets/prost_ipc/generated_client_server_api.rs" )<|endoftext|>
fim
zellij-org/zellij
rust
<|fim_prefix|>// The following license refers to code in this file and this file only. // We chose to vendor this dependency rather than depend on it through crates.io in order to facilitate // packaging. This license was copied verbatim from: https://docs.rs/crate/common-path/1.0.0/source/LICENSE-MIT // // MIT License...
fim
zellij-org/zellij
rust
//! Zellij program-wide constants. use crate::home::find_default_config_dir; use directories::ProjectDirs; use include_dir::{include_dir, Dir}; use lazy_static::lazy_static; use std::{path::PathBuf, sync::OnceLock}; use uuid::Uuid; pub const ZELLIJ_CONFIG_FILE_ENV: &str = "ZELLIJ_CONFIG_FILE"; pub const ZELLIJ_CONFIG...
fim
zellij-org/zellij
rust
<|fim_suffix|>d, cannot perform requests - this is likely a misconfiguration of isahc::HttpClient"); return Ok(()); }; let file_name = match file_name { Some(name) => name.to_string(), None => self.parse_name(url)?, }; // we do this to make sure only ...
fim
zellij-org/zellij
rust
<|fim_prefix|>/// Uniformly operates ZELLIJ* environment variables use anyhow::Result; use serde::{Deserialize, Serialize}; use std::{ collections::{BTreeMap, HashMap}, env::{set_var, var}, }; use std::fmt; pub const ZELLIJ_ENV_KEY: &str = "ZELLIJ"; pub fn get_zellij() -> Result<String> { Ok(var(ZELLIJ_EN...
fim
zellij-org/zellij
rust
<|fim_suffix|>e, ConfigWrittenToDisk, FailedToWriteConfigToDisk, RebindKeys, StartWebServer, ShareCurrentSession, StopSharingCurrentSession, WebServerStarted, FailedToStartWebServer, SendWebClientsForbidden, ClearMouseHelpText, ForwardQueryToHost, } #[derive(Debug, Clone, Co...
fim
zellij-org/zellij
rust
<|fim_prefix|>//! //! # This module contain everything you'll need to access local system paths //! containing configuration and layouts use crate::consts::{SYSTEM_DEFAULT_CONFIG_DIR, ZELLIJ_PROJ_DIR}; use std::{path::Path, path::PathBuf}; #[cfg(not(windows))] use crate::home_unix as platform; #[cfg(windows)] use cr...
fim
zellij-org/zellij
rust