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_512100 | rust_dataset.txt | 512,100 | 512 | _millis(50));
}
}
fn type_into_panel(&self, text: &str) {
let plugin = self.wait_for_panel_plugin();
let keys = text
.chars()
.map(|character| press(plugin, BareKey::Char(character)))
.collect();
self.act_on_panel(keys);
}
fn press_en... |
rust_dataset_chunk_512101 | rust_dataset.txt | 512,101 | 512 | .stop_everything();
let _ = self.xvfb.kill();
let _ = self.xvfb.wait();
}
}
fn press(plugin: u32, bare_key: BareKey) -> Action {
Action::WriteKeyToPaneId {
key_with_modifier: Some(KeyWithModifier::new(bare_key)),
pane_id: PaneId::Plugin(plugin),
}
}
fn panel(view: PopupView... |
rust_dataset_chunk_512102 | rust_dataset.txt | 512,102 | 512 | fn a_panel_shortcut_without_a_running_app_starts_the_app_with_only_the_panel() {
let Some(mut desktop) = Desktop::start() else {
return;
};
desktop.launch(&["--inbox"]);
let state = desktop.wait_for_state("the inbox panel", |state| {
state.panel == panel(PopupView::Inbox)
});
ass... |
rust_dataset_chunk_512103 | rust_dataset.txt | 512,103 | 512 | .is_none()
});
assert_eq!(
state.windows.len(),
2,
"the window already on the session is brought forward instead of opening another"
);
}
#[test]
fn confirming_quit_in_the_panel_stops_every_session_and_the_app() {
let Some(mut desktop) = Desktop::start() else {
return;
... |
rust_dataset_chunk_512104 | rust_dataset.txt | 512,104 | 512 | (PopupView::Inbox)
});
desktop.wait_for_panel_to_show("Inbox");
desktop.toggle_inbox_with_the_shortcut();
desktop.wait_for_state("the panel closed", |state| state.panel.is_none());
assert_eq!(
send_app_request_to(
&desktop.control_socket(),
&AppRequest::ShowPopup(Popu... |
rust_dataset_chunk_512105 | rust_dataset.txt | 512,105 | 512 | replaces
};
let text = call
.body
.iter()
.filter_map(Value::as_str)
.collect::<Vec<_>>()
.join(" ");
shown.push((id, text));
}
shown
}
fn notification_about(&self... |
rust_dataset_chunk_512106 | rust_dataset.txt | 512,106 | 512 | ToClientMsg::UnblockInputThread | ServerToClientMsg::Exit { .. } => {
return None
},
_ => {},
}
}
}
}
#[test]
fn a_session_needing_you_shows_a_notification_and_seeing_it_withdraws_it() {
let Some(mut desktop) = Desktop::start_with_bus() el... |
rust_dataset_chunk_512107 | rust_dataset.txt | 512,107 | 512 | ::from_millis(50));
}
}
}
#[test]
fn the_tray_icon_registers_and_its_menu_works() {
let Some(mut desktop) = Desktop::start_with_bus() else {
return;
};
let first = desktop.start_app();
desktop.start_background_session("paused");
desktop.start_background_session("resumed");
d... |
rust_dataset_chunk_512108 | rust_dataset.txt | 512,108 | 512 | .expect("zellij action runs");
assert!(status.success());
};
toggle(&desktop);
desktop.wait_for_state("the icon to flip", |state| state.tray_icon != before);
toggle(&desktop);
desktop.wait_for_state("the icon to flip back", |state| state.tray_icon == before);
}
#[test]
fn a_laun... |
rust_dataset_chunk_512109 | rust_dataset.txt | 512,109 | 512 | (),
&AppRequest::OpenWindow(OpenWindowRequest {
session: Some("solo".to_owned()),
create: false,
..Default::default()
})
),
Ok(AppReply::Done)
);
std::thread::sleep(QUIET);
let state = desktop.state().unwrap();
asser... |
rust_dataset_chunk_512110 | rust_dataset.txt | 512,110 | 512 | .env(
zellij_utils::desktop_integration::DESKTOP_OVERRIDE_ENV,
"on",
)
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.expect("zellij runs");
assert!(status.success());
assert!(!entries[0].exists());
}
#[test]
fn a_new_session_win... |
rust_dataset_chunk_512111 | rust_dataset.txt | 512,111 | 512 | .wait_for_state("a window on a second session", |state| {
state.windows.iter().any(|window| is_new(&window.session))
});
let session = state
.windows
.iter()
.find(|window| is_new(&window.session))
.and_then(|window| window.session.clone())
.unwrap();
let fold... |
rust_dataset_chunk_512112 | rust_dataset.txt | 512,112 | 512 | = "one-first";
const SECOND: &str = "zzz-second";
const DECOY: &str = "0-decoy";
impl Desktop {
fn clients_of(&self, session: &str) -> Option<Vec<(u32, String)>> {
let mut link = SessionLink::open_path(&self.socket_of(session)).ok()?;
link.send(ClientToServerMsg::Action {
action: Actio... |
rust_dataset_chunk_512113 | rust_dataset.txt | 512,113 | 512 | fn act_as(&self, session: &str, client: u32, action: Action) {
let mut link =
SessionLink::open_path(&self.socket_of(session)).expect("the session answers");
link.send(ClientToServerMsg::Action {
action,
terminal_id: None,
client_id: Some(client),
... |
rust_dataset_chunk_512114 | rust_dataset.txt | 512,114 | 512 | }
fn configure_windows(&self, window_section: &str) {
std::fs::write(
self.root.path().join("config/zellij/config.kdl"),
format!("{}terminal {{\n{}\n}}\n", CONFIG, window_section),
)
.unwrap();
}
}
fn windows_on(state: &AppState, session: &str) -> usize {
... |
rust_dataset_chunk_512115 | rust_dataset.txt | 512,115 | 512 | 0);
}
#[test]
fn going_back_in_a_raised_window_with_its_own_history_returns_where_the_user_came_from() {
let Some(mut desktop) = Desktop::start() else {
return;
};
desktop.create_background_session("own-a");
desktop.create_background_session("own-b");
desktop.start_app_on(&[FIRST, SECOND])... |
rust_dataset_chunk_512116 | rust_dataset.txt | 512,116 | 512 | the target to stay", |state| {
only_on(state, SECOND)
});
desktop.wait_for_clients(SECOND, |clients| {
clients == [(second_window, "terminal_0".to_owned())]
});
}
#[test]
fn with_window_reuse_off_the_window_switches_in_place_and_both_stay_open() {
let Some(mut desktop) = Desktop::start... |
rust_dataset_chunk_512117 | rust_dataset.txt | 512,117 | 512 | 2);
desktop.wait_for_client_count(FIRST, 0);
assert!(
desktop.apps[standalone].try_wait().unwrap().is_none(),
"the standalone window closed\n{}",
desktop.logs()
);
assert!(desktop.answers(FIRST));
assert!(
desktop.apps[0].try_wait().unwrap().is_none(),
"the a... |
rust_dataset_chunk_512118 | rust_dataset.txt | 512,118 | 512 | child = self
.terminal_command(extra)
.envs(env.iter().copied())
.stdout(log.try_clone().unwrap())
.stderr(log)
.spawn()
.expect("the zellij executable starts");
self.apps.push(child);
index
}
fn cli(&self, args: &[&str], ... |
rust_dataset_chunk_512119 | rust_dataset.txt | 512,119 | 512 | fs::read_to_string(path).ok();
if read.as_deref() == Some(expected) {
return;
}
if Instant::now() >= deadline {
panic!(
"timed out waiting for {} to read {:?}, it reads {:?}\n{}",
path.display(),
... |
rust_dataset_chunk_512120 | rust_dataset.txt | 512,120 | 512 | (100));
}
}
}
#[test]
fn panes_of_the_app_name_zellij_and_not_the_terminal_the_app_was_started_from() {
let Some(mut desktop) = Desktop::start() else {
return;
};
desktop.launch_with_env(
&[],
&[
("TERM_PROGRAM", "iTerm.app"),
("TERM_PROGRAM_VERSI... |
rust_dataset_chunk_512121 | rust_dataset.txt | 512,121 | 512 | ane("displays", script, &after);
let expected = format!("{}|", desktop.display);
desktop.wait_for_file(&after, &expected);
}
#[test]
fn copying_still_reaches_the_system_clipboard_after_the_window_is_closed_and_reopened() {
let Some(mut desktop) = Desktop::start() else {
return;
};
let sessi... |
rust_dataset_chunk_512122 | rust_dataset.txt | 512,122 | 512 | .root.path().join("reached.txt");
let script = format!(
"printf '%s' \"$ZELLIJ_SESSION_ID\" > '{}'",
report.display()
);
let pane_env = [
("ZELLIJ", "0"),
("ZELLIJ_SESSION_NAME", "work"),
("ZELLIJ_SESSION_ID", id.as_str()),
];
let output = desktop.cli(&["run",... |
rust_dataset_chunk_512123 | rust_dataset.txt | 512,123 | 512 | ::connection::Connection;
use x11rb::protocol::xproto::{
Atom, AtomEnum, ClientMessageEvent, ConnectionExt as _, CreateWindowAux, EventMask,
MapState, PropMode, SelectionNotifyEvent, SelectionRequestEvent, Window, WindowClass,
SELECTION_NOTIFY_EVENT,
};
use x11rb::protocol::Event;
... |
rust_dataset_chunk_512124 | rust_dataset.txt | 512,124 | 512 | 0],
)?;
send(
atoms.XdndPosition,
[
source,
0,
position,
x11rb::CURRENT_TIME,
atoms.XdndActionCopy,
],
)?;
// Events reach winit in the order sent, so it reads the data b... |
rust_dataset_chunk_512125 | rust_dataset.txt | 512,125 | 512 | : request.time,
requestor: request.requestor,
selection: request.selection,
target: request.target,
property,
};
conn.send_event(false, request.requestor, EventMask::NO_EVENT, notify)?;
conn.flush()?;
Ok(())
}
fn wait_for_drop_targ... |
rust_dataset_chunk_512126 | rust_dataset.txt | 512,126 | 512 | write(&file, b"").unwrap();
let file = file.canonicalize().unwrap();
desktop.wait_for_screen(&session, "the shell prompt", |screen| {
screen.trim_end().ends_with(['$', '#'])
});
if let Err(e) = xdnd::drop_file(&desktop.display, &file) {
panic!("dropping the file failed: {:#}\n{}", e, de... |
rust_dataset_chunk_512127 | rust_dataset.txt | 512,127 | 512 | location="status-bar"
}
}
"#;
static INSTALL: Once = Once::new();
fn install_distribution() {
INSTALL.call_once(|| {
distribution::set_distribution(
Distribution::new("testdist", "9.9.9")
.with_display_name("Test Distribution")
.with_plugin("bundled-plugin"... |
rust_dataset_chunk_512128 | rust_dataset.txt | 512,128 | 512 | let mut zellij = start_with_bundled_layout();
let terminal = zellij.expect_pty_spawn();
terminal.output(b"$ ");
let grid_snapshot = zellij.wait_until("bundled layout rendered", |grid| {
grid.contains("Received events:") && grid.tab_bar_appears() && grid.status_bar_appears()
});
insta::a... |
rust_dataset_chunk_512129 | rust_dataset.txt | 512,129 | 512 | Vec<u8> {
format!("\u{1b}[<{};{};{}m", button, column, line).into_bytes()
}
fn start_with_config(extra_config: &str) -> TestSession {
TestRunner::new(TERMINAL_SIZE)
.with_config(&format!("{}\n{}", BASE_CONFIG, extra_config))
.start()
}
fn claim_framed_terminal(zellij: &TestSession, marker: &'... |
rust_dataset_chunk_512130 | rust_dataset.txt | 512,130 | 512 | 1, start_column - 1) == Some('└')
&& cell(grid_snapshot, end_line - 1, end_column - 1) == Some('┘')
}
fn drag_without_releasing(
zellij: &TestSession,
modifiers: u8,
start: (usize, usize),
end: (usize, usize),
) {
zellij.send_stdin(&sgr_press(start.0, start.1, LEFT + modifiers));
zellij... |
rust_dataset_chunk_512131 | rust_dataset.txt | 512,131 | 512 | (grid_snapshot) == 1
});
assert_eq!(
cell(&grid_snapshot, 5, 11),
Some('D'),
"{}",
grid_snapshot.text
);
zellij.quit();
}
#[test]
fn a_ctrl_drag_up_and_to_the_left_opens_the_same_rectangle() {
let mut zellij = start_with_config("");
claim_framed_terminal(&zellij,... |
rust_dataset_chunk_512132 | rust_dataset.txt | 512,132 | 512 | (&grid_snapshot),
0,
"{}",
grid_snapshot.text
);
drag(&zellij, CTRL, (11, 5), (71, 16));
let drawn_terminal = zellij.expect_pty_spawn();
drawn_terminal.output(b"DRAWN-MARKER");
zellij.wait_until("only the second drag opened a pane", |grid_snapshot| {
grid_snapshot.co... |
rust_dataset_chunk_512133 | rust_dataset.txt | 512,133 | 512 | pane is shown", |grid_snapshot| {
grid_snapshot.contains("DRAWN-MARKER")
});
let program_stdin = String::from_utf8_lossy(&terminal.stdin_bytes()).to_string();
assert!(!program_stdin.contains("\u{1b}[<"), "{:?}", program_stdin);
zellij.quit();
}
#[test]
fn a_ctrl_drag_goes_to_a_program_using_th... |
rust_dataset_chunk_512134 | rust_dataset.txt | 512,134 | 512 | title_line = grid_snapshot
.row_of_line("strider")
.expect("the plugin pane has a title");
assert_eq!(title_line, 4, "{}", grid_snapshot.text);
assert_eq!(
cell(&grid_snapshot, 4, 10),
Some('┌'),
"{}",
grid_snapshot.text
);
assert_eq!(
cell(&grid_... |
rust_dataset_chunk_512135 | rust_dataset.txt | 512,135 | 512 | events, "initial state", |e| is_event(e, "initial_state"));
initial_state["panes"]
.as_array()
.unwrap()
.iter()
.find(|pane| pane["is_plugin"] == false)
.map(|pane| pane["pane_id"].as_str().unwrap().to_owned())
.expect("a terminal pane in the initial state")
}
fn op... |
rust_dataset_chunk_512136 | rust_dataset.txt | 512,136 | 512 | _for_prompt(&zellij);
let opened = wait_for_event(&events, "pane opened", |e| is_event(e, "pane_opened"));
let new_pane_id = opened_pane_id(&opened);
let focused = wait_for_event(&events, "new pane focused", |e| {
is_event(e, "pane_focused") && e["pane_id"] == new_pane_id.as_str()
});
asser... |
rust_dataset_chunk_512137 | rust_dataset.txt | 512,137 | 512 | .expect("the new tab's pane was reported");
assert!(created_index < opened_index);
}
#[test]
fn type_filter_only_emits_the_requested_events() {
let zellij = start_zellij();
claim_first_terminal_and_wait_for_prompt(&zellij);
let events = start_listening(&zellij, &["--type", "tab_created"]);
open_n... |
rust_dataset_chunk_512138 | rust_dataset.txt | 512,138 | 512 | mut zellij: TestSession,
probe: CliOutputHandle,
events: CliOutputHandle,
check_filtered: impl Fn(&[Value]),
) {
zellij.quit();
probe.wait_for_exit();
check_filtered(&parse_events(&events.wait_for_exit().stdout));
}
#[test]
fn cwd_reported_by_the_shell_is_streamed_with_its_tab() {
let z... |
rust_dataset_chunk_512139 | rust_dataset.txt | 512,139 | 512 | input_mode: InputMode::RenamePane,
});
wait_for_event(&events, "rename pane mode entered", |e| {
is_event(e, "mode_changed") && e["mode"] == "renamepane"
});
client.send_action(Action::PaneNameInput {
input: b"draft".to_vec(),
});
let renamed = wait_for_event(&events, "pane rena... |
rust_dataset_chunk_512140 | rust_dataset.txt | 512,140 | 512 | bind "Alt m" { FocusLastPane; }
bind "Alt ." { FocusNextPane; }
}
}
"#;
fn start_with_focus_keys(size: Size) -> TestSession {
TestRunner::new(size).with_config(FOCUS_KEYS_CONFIG).start()
}
fn split_focused_pane_down(zellij: &TestSession) -> FakePtyHandle {
zellij.send_stdin(&keys::ctrl('p'... |
rust_dataset_chunk_512141 | rust_dataset.txt | 512,141 | 512 | focus_last_pane_refills_after_cycling_focus() {
let mut zellij = start_with_focus_keys(TERMINAL_SIZE);
claim_first_terminal_and_wait_for_prompt(&zellij);
split_right_and_wait_for_prompt(&zellij);
zellij.send_stdin(&keys::alt('.'));
zellij.wait_until("focus cycled away from the right pane", |grid| ... |
rust_dataset_chunk_512142 | rust_dataset.txt | 512,142 | 512 | let first_floating_cursor = zellij
.wait_until("first floating pane focused after its prompt", |grid| {
grid.contains("Pane #2") && grid.cursor != tiled_cursor && cursor_follows_prompt(grid)
})
.cursor
.unwrap();
let (_second_floating, second_floating_row) =
ope... |
rust_dataset_chunk_512143 | rust_dataset.txt | 512,143 | 512 | Engine as _;
use insta::assert_snapshot;
use zellij_integration_tests::client_screen::render_bytes;
use zellij_integration_tests::{
claim_first_terminal_and_wait_for_prompt, col, keys, normalized,
split_right_and_wait_for_prompt, start_zellij, FakePtyHandle, GridSnapshot, HostTerminal,
LayoutInfo, Size, Tes... |
rust_dataset_chunk_512144 | rust_dataset.txt | 512,144 | 512 | = b"\x1b[?2027l";
const EXIT_ALTERNATE_SCREEN: &[u8] = b"\x1b[?1049l";
const BACKSPACE: [u8; 1] = [0x7f];
const MOUSE_CONFIG: &str = "mouse_mode true\ncopy_clipboard \"system\"";
const PER_CODE_POINT: &str = "grapheme_clusters false";
const FLOATING_LEFT_BORDER: usize = 30;
const FLOATING_RIGHT_BORDER: usize = 89;
c... |
rust_dataset_chunk_512145 | rust_dataset.txt | 512,145 | 512 | f600}\u{fe0e}",
columns: 2,
shown: "\u{1f600}\u{fe0e}",
},
Sample {
label: "keycap",
input: "1\u{fe0f}\u{20e3}",
columns: 1,
shown: "1\u{20e3}",
},
Sample {
label: "thumbs up with a skin tone",
input: THUMBS,
columns: 4,
sho... |
rust_dataset_chunk_512146 | rust_dataset.txt | 512,146 | 512 | with a voicing mark",
input: "\u{ff76}\u{ff9e}",
columns: 1,
shown: "\u{ff76}\u{ff9e}",
},
Sample {
label: "soft hyphen",
input: "a\u{ad}b",
columns: 2,
shown: "a\u{ad}b",
},
Sample {
label: "zero-width code point at column zero",
... |
rust_dataset_chunk_512147 | rust_dataset.txt | 512,147 | 512 | zellij.wait_until("the right pane opened", |grid_snapshot| {
grid_snapshot.status_bar_appears() && opened(grid_snapshot)
});
terminal
}
fn find_bytes(haystack: &[u8], needle: &[u8]) -> Option<usize> {
if needle.is_empty() || haystack.len() < needle.len() {
return None;
}
haystac... |
rust_dataset_chunk_512148 | rust_dataset.txt | 512,148 | 512 | (b"\x1b[6n");
let stdin = terminal.wait_for_stdin("the pane reported its cursor", move |stdin| {
cursor_reports(stdin).len() > seen
});
*cursor_reports(&stdin)
.last()
.expect("the pane reported its cursor")
}
fn copied_texts(bytes: &[u8]) -> Vec<String> {
let marker: &[u8] = b"... |
rust_dataset_chunk_512149 | rust_dataset.txt | 512,149 | 512 | 0,
0x1f3f3 | 0x1f1e6..=0x1f1ff => 1,
0x1100..=0x115f | 0x4e00..=0x9fff | 0x1f300..=0x1faff => 2,
_ => 1,
}
}
fn columns_in_default_mode(text: &str) -> usize {
text.chars().map(code_point_width).sum()
}
fn units_in_grapheme_mode(text: &str) -> Vec<(usize, &str)> {
let mut units = V... |
rust_dataset_chunk_512150 | rust_dataset.txt | 512,150 | 512 | needle)
.map(|byte_index| columns_in_grapheme_mode(&line[..byte_index]))
}
fn families_are_whole(line: &str) -> bool {
let whole = line.matches(FAMILY).count();
line.matches('\u{1f468}').count() == whole
&& line.matches('\u{1f469}').count() == whole
&& line.matches('\u{1f467}').count() ... |
rust_dataset_chunk_512151 | rust_dataset.txt | 512,151 | 512 | │').collect();
assert_eq!(
parts.len(),
3,
"the row must show both borders of the floating pane, got {:?}",
line
);
assert_eq!(
columns_in_default_mode(parts[0]),
FLOATING_LEFT_BORDER,
"the left border of the floating pane moved, got {:?}",
lin... |
rust_dataset_chunk_512152 | rust_dataset.txt | 512,152 | 512 | }
fn wait_for_renamed_pane(zellij: &TestSession, name_visible: bool) -> GridSnapshot {
zellij.wait_until("the pane renamed", |grid_snapshot| {
grid_snapshot.status_bar_appears()
&& !grid_snapshot.contains("RENAMING PANE")
&& (!name_visible || grid_snapshot.contains(RENAMED))
})
... |
rust_dataset_chunk_512153 | rust_dataset.txt | 512,153 | 512 | let row = grid_snapshot
.row_of_line(marker)
.expect("the match is on screen");
let cells = highlighted_cells(&grid_snapshot, row);
zellij.quit();
cells
}
#[test]
fn default_mode_keeps_every_cluster_category_at_per_code_point_widths() {
let mut zellij = start_zellij_per_code_point();
... |
rust_dataset_chunk_512154 | rust_dataset.txt | 512,154 | 512 | .start();
let terminal = claim_first_terminal_and_wait_for_prompt(&zellij);
terminal.disable_echo();
let line = format!("WARN{}|end", WARNING_WITH_VS16);
terminal.output(format!("\r\n{}", line).as_bytes());
let grid_snapshot = zellij.wait_until("the warning sign rendered", |grid_snapshot| {
... |
rust_dataset_chunk_512155 | rust_dataset.txt | 512,155 | 512 | terminal.output(format!("\x1b[?2027h\x1b[3;1H{}", FAMILY).as_bytes());
assert_eq!(
report_cursor(&terminal),
(3, 3),
"a family emoji in grapheme cluster mode advances the cursor by two columns"
);
zellij.wait_until("the family emoji rendered", |grid_snapshot| {
grid_snapshot... |
rust_dataset_chunk_512156 | rust_dataset.txt | 512,156 | 512 | terminal.wait_for_stdin("the mode reported as reset again", |stdin| {
occurrences(stdin, b"\x1b[?2027;2$y") == 2
});
assert_eq!(
occurrences(&stdin, b"\x1b[?2027;1$y"),
1,
"the mode is reported as set only while it is set"
);
zellij.quit();
}
#[test]
fn clusters_are_cou... |
rust_dataset_chunk_512157 | rust_dataset.txt | 512,157 | 512 | the program asked to turn the mode off"
);
let stdin = terminal.wait_for_stdin("the replies so far", |_| true);
assert_eq!(
occurrences(&stdin, b"\x1b[?2027;2$y"),
0,
"the mode is never reported as reset"
);
zellij.quit();
}
#[test]
fn widening_at_the_last_column_wraps_the_... |
rust_dataset_chunk_512158 | rust_dataset.txt | 512,158 | 512 | to one column and the cursor moves back"
);
terminal.output(b"X");
zellij.wait_until("the narrowed cluster rendered", |grid_snapshot| {
grid_snapshot.cursor_is_at(col(2).row(5))
&& grid_snapshot
.lines()
.get(5)
.map_or(false, |line| line.... |
rust_dataset_chunk_512159 | rust_dataset.txt | 512,159 | 512 | lines[3 + index];
let (left_part, right_part) = line
.split_once('│')
.unwrap_or_else(|| panic!("the border between the panes is missing in {:?}", line));
assert_eq!(
left_part,
row.as_str(),
"the left pane row must end exactly at the border"
... |
rust_dataset_chunk_512160 | rust_dataset.txt | 512,160 | 512 | _a = format!(
"{}{}{}\u{1f600}{}",
"x".repeat(27),
FAMILY,
"y".repeat(56),
"z".repeat(29)
);
let row_b = format!(
"{}\u{1f600}{}{}{}",
"x".repeat(29),
"y".repeat(55),
FAMILY,
"z".repeat(28)
);
tiled.output(format!("\x1b[11;1... |
rust_dataset_chunk_512161 | rust_dataset.txt | 512,161 | 512 | .lines()[14], '\u{1f600}', '\u{1f469}');
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn only_a_client_whose_host_answers_turns_on_grapheme_cluster_mode() {
let mut zellij = start_zellij_with_grapheme_aware_host(PER_CODE_POINT);
let terminal = claim_first_terminal_and_wait_for... |
rust_dataset_chunk_512162 | rust_dataset.txt | 512,162 | 512 | mode on"
);
assert!(
!contains_bytes(&silent_bytes, DISABLE_GRAPHEME_CLUSTER_MODE),
"a client whose host did not answer must not turn the mode off"
);
zellij.detach_main_client();
let answering_bytes = zellij.raw_bytes();
assert_eq!(
occurrences(&answering_bytes, DISABL... |
rust_dataset_chunk_512163 | rust_dataset.txt | 512,163 | 512 | assert!(
last_copy.contains(&format!("|{}|", DECOMPOSED_E)),
"the copied text keeps the combining accent, got {:?}",
last_copy
);
zellij.quit();
}
#[test]
fn search_highlights_the_columns_of_cluster_matches() {
let family_cells =
highlighted_cells_after_searching(&format!("... |
rust_dataset_chunk_512164 | rust_dataset.txt | 512,164 | 512 | ellij.wait_until("the clusters rewrapped whole", |grid_snapshot| {
line_followed_by(grid_snapshot, &group_head, &group_tail)
&& line_followed_by(grid_snapshot, &cluster_head, &cluster_tail)
});
zellij.resize(TERMINAL_SIZE);
terminal.wait_for_size("the pane widened", |cols, _| {
... |
rust_dataset_chunk_512165 | rust_dataset.txt | 512,165 | 512 | _for_renamed_pane(&zellij, true);
let title_row = grid_snapshot
.row_of_line(RENAMED)
.expect("the new name is shown");
assert_name_kept_whole(&grid_snapshot.lines()[title_row]);
assert_frame_row_lines_up(&grid_snapshot, title_row, &['┌', '┐'], title_row + 1);
assert_snapshot!(normalized... |
rust_dataset_chunk_512166 | rust_dataset.txt | 512,166 | 512 | flag must not appear anywhere"
);
zellij.quit();
}
#[test]
fn pane_rename_with_clusters_lines_up_in_a_stack() {
let mut zellij = start_zellij_with_grapheme_aware_host("");
claim_first_terminal_and_wait_for_prompt(&zellij);
zellij.send_stdin(&keys::ctrl('p'));
zellij.send_stdin(&keys::key('s'))... |
rust_dataset_chunk_512167 | rust_dataset.txt | 512,167 | 512 | _pane_by_typing(&zellij);
let grid_snapshot = wait_for_renamed_pane(&zellij, true);
let title_row = grid_snapshot
.row_of_line(RENAMED)
.expect("the new name is shown");
assert_name_kept_whole(&grid_snapshot.lines()[title_row]);
assert_frame_row_lines_up(&grid_snapshot, title_row, &['┌',... |
rust_dataset_chunk_512168 | rust_dataset.txt | 512,168 | 512 | ellij.wait_until(
"the tab to the right of the renamed tab selected",
|grid_snapshot| {
grid_snapshot.contains("second-tab-content")
&& !grid_snapshot.contains("first-tab-content")
},
);
click_on_offset(&zellij, &grid_snapshot, 0, &cli_name_shown, 3);
zell... |
rust_dataset_chunk_512169 | rust_dataset.txt | 512,169 | 512 | .with_layout(LayoutInfo::BuiltIn("compact".to_owned()))
.with_host_terminal(HostTerminal::GraphemeClusterAware(2))
.start();
zellij.wait_until_raw_output(
"the client turned on grapheme cluster mode in its host terminal",
|bytes| contains_bytes(bytes, ENABLE_GRAPHEME_CLUSTER_MODE),
... |
rust_dataset_chunk_512170 | rust_dataset.txt | 512,170 | 512 | grid_snapshot| {
grid_snapshot.lines().get(1).map_or(false, |row| {
row.contains(&left_title) && row.contains(&right_title)
})
});
assert_frame_row_lines_up(&grid_snapshot, 1, &['│'], 2);
let long_title_start = format!("L{}", FAMILY);
left.output(format!("\x1b]2;L{}TAIL\x07"... |
rust_dataset_chunk_512171 | rust_dataset.txt | 512,171 | 512 | });
assert_eq!(
line_containing(&watched, "V:"),
line_containing(&main, "V:"),
"the watcher and the main client must show the same clusters"
);
watcher.quit();
zellij.quit();
}
#[test]
fn a_plugin_pane_stores_a_zwj_emoji_as_one_two_column_cluster() {
let mut zellij = start_... |
rust_dataset_chunk_512172 | rust_dataset.txt | 512,172 | 512 | {};{};{}M", button, column, line).into_bytes()
}
fn sgr_release(column: usize, line: usize, button: u8) -> Vec<u8> {
format!("\u{1b}[<{};{};{}m", button, column, line).into_bytes()
}
fn right_click(zellij: &TestSession, column: usize, line: usize) {
zellij.send_stdin(&sgr_press(column, line, 2));
zellij.s... |
rust_dataset_chunk_512173 | rust_dataset.txt | 512,173 | 512 | _other_in_place() {
let mut zellij = start_zellij_with("hidden_bars_notification false");
claim_first_terminal_and_wait_for_prompt(&zellij);
let exit_code = zellij.run_cli_action(CliAction::HideBars {
bars: vec!["tab-bar".to_owned()],
});
assert_eq!(exit_code, 0);
zellij.wait_until("onl... |
rust_dataset_chunk_512174 | rust_dataset.txt | 512,174 | 512 | )
});
zellij.quit();
}
#[test]
fn key_hints_stay_away_while_the_status_bar_still_shows_the_mode() {
let mut zellij = start_zellij_with("hidden_bars_notification false");
claim_first_terminal_and_wait_for_prompt(&zellij);
let exit_code = zellij.run_cli_action(CliAction::HideBars {
bars: vec... |
rust_dataset_chunk_512175 | rust_dataset.txt | 512,175 | 512 | second user is not in a mode and sees no key hints:\n{}",
second_grid.text
);
zellij.quit();
}
#[test]
fn the_right_click_menu_hides_the_clicked_bar_and_shows_the_bars_again() {
let mut zellij = start_zellij_with("mouse_mode true\nhidden_bars_notification false");
claim_first_terminal_and_wait... |
rust_dataset_chunk_512176 | rust_dataset.txt | 512,176 | 512 | 30, 10);
let grid_snapshot = zellij.wait_until("the pane menu opened", |grid_snapshot| {
grid_snapshot.contains("Close pane")
});
assert!(
!grid_snapshot.contains(SHOW_BARS_MENU_ITEM),
"nothing is hidden yet, so there is nothing to show:\n{}",
grid_snapshot.text
);
z... |
rust_dataset_chunk_512177 | rust_dataset.txt | 512,177 | 512 | =true {{
plugin location="tab-bar"
}}
children
pane size=1 borderless=true {{
plugin location="status-bar"
}}
}}
tab {{
pane stacked=true {} {{
{} }}
}}
}}
"#,
stack_properties, members
)
}
fn start_with_stack(
size: Siz... |
rust_dataset_chunk_512178 | rust_dataset.txt | 512,178 | 512 | , title)
&& grid_snapshot.contains(&member_content)
&& !grid_snapshot.contains(COLUMN_ENTRY_MARKER)
})
}
fn wait_for_column_with_selected(zellij: &TestSession, title: &str) -> GridSnapshot {
let selected_entry = format!("{}{}", COLUMN_ENTRY_MARKER, title);
zellij.wait_until("titles ... |
rust_dataset_chunk_512179 | rust_dataset.txt | 512,179 | 512 | = row_start;
let space_after = TERMINAL_SIZE.cols - row_end;
assert!(
space_before.abs_diff(space_after) <= 1,
"before={} after={} line={:?}",
space_before,
space_after,
line
);
zellij.quit();
}
#[test]
fn moving_focus_left_and_right_moves_the_selection_through_... |
rust_dataset_chunk_512180 | rust_dataset.txt | 512,180 | 512 | });
zellij.quit();
}
#[test]
fn clicking_a_title_in_the_row_swaps_its_pane_in() {
let mut zellij = start_with_three_member_row("mouse_mode true");
let grid_snapshot = wait_for_row_with_selected(&zellij, "Pane #1");
click_on_text(&zellij, &grid_snapshot, "Pane #3", 0);
wait_for_row_with_selecte... |
rust_dataset_chunk_512181 | rust_dataset.txt | 512,181 | 512 | 2);
let menu = zellij.wait_until("pane menu opened on the content", |grid_snapshot| {
grid_snapshot.contains(PANE_MENU_MARKER)
});
assert!(!menu.contains(MENU_ITEM_TO_ROW));
assert!(!menu.contains(MENU_ITEM_TO_COLUMN));
zellij.send_stdin(&keys::ESC);
zellij.wait_until("pane menu closed"... |
rust_dataset_chunk_512182 | rust_dataset.txt | 512,182 | 512 | , "line {:?}", grid_snapshot.lines()[row]);
zellij.quit();
}
--- FILE: zellij/zellij-integration-tests/tests/inbox_keys.rs ---
#![cfg(unix)]
use std::time::Duration;
use zellij_integration_tests::attention::{counted, needs_you, session_counts, wait_for_counted};
use zellij_integration_tests::inbox::{
backgro... |
rust_dataset_chunk_512183 | rust_dataset.txt | 512,183 | 512 | client_screen::AnsiCode>) -> bool {
!matches!(
code,
None | Some(zellij_integration_tests::client_screen::AnsiCode::Reset)
)
}
fn is_selected(grid_snapshot: &GridSnapshot, row: &str) -> bool {
grid_snapshot
.text
.lines()
.enumerate()
.filter_map(|(y, line)| ... |
rust_dataset_chunk_512184 | rust_dataset.txt | 512,184 | 512 | , exit
)
.as_bytes(),
);
}
fn two_items(zellij: &TestSession) -> (BackgroundTestSession, BackgroundTestSession) {
let (older, older_terminal) = background_session_with(ATTENTION_CONFIG);
let (newer, newer_terminal) = background_session_with(ATTENTION_CONFIG);
older_terminal.output(&need... |
rust_dataset_chunk_512185 | rust_dataset.txt | 512,185 | 512 | shift_c_dismisses_everything_in_every_session() {
let (mut zellij, _) = main_session();
let (older, newer) = two_items(&zellij);
open_inbox_on(&zellij, "Newer question?");
zellij.send_stdin(b"C");
wait_for_counted(older.session_name(), 0);
wait_for_counted(newer.session_name(), 0);
zellij.w... |
rust_dataset_chunk_512186 | rust_dataset.txt | 512,186 | 512 | command is counted", "✗ 1");
open_inbox_on(&zellij, "exited 1");
zellij.wait_until("the item is selected", |grid_snapshot| {
is_selected(grid_snapshot, &row_of("✗", other.session_name()))
});
zellij.send_stdin(&keys::key('n'));
zellij.send_stdin(&keys::key('?'));
zellij.wait_until("all ... |
rust_dataset_chunk_512187 | rust_dataset.txt | 512,187 | 512 | ) = one_counted_and_one_muted(&zellij);
let muted_row = row_of("⊘", muted.session_name());
open_inbox_on(&zellij, "Counted question?");
let grid_snapshot = zellij
.wait_until("the muted item waits behind the line", |grid_snapshot| {
grid_snapshot.contains(HIDDEN_LINE)
});
cli... |
rust_dataset_chunk_512188 | rust_dataset.txt | 512,188 | 512 | _inbox_on(&zellij, "Type here?");
press_type_key(&zellij);
zellij.wait_until("typing started", |grid_snapshot| {
grid_snapshot.contains(TYPING_INTO)
});
press_esc(&zellij);
terminal.wait_for_stdin("escape reached the pane", |stdin| stdin.ends_with(b"\x1b"));
zellij.send_stdin(b"x");
... |
rust_dataset_chunk_512189 | rust_dataset.txt | 512,189 | 512 | open_inbox_on(&zellij, "Newer question?");
let grid_snapshot = zellij.wait_until("the newest item is selected", |grid_snapshot| {
is_selected(grid_snapshot, &newer_row)
&& grid_snapshot.contains(&older_row)
&& !is_selected(grid_snapshot, &older_row)
});
click(&zellij, &gr... |
rust_dataset_chunk_512190 | rust_dataset.txt | 512,190 | 512 | .quit();
}
#[test]
fn clicking_the_tab_headers_switches_between_inbox_and_sessions() {
let (mut zellij, _) = main_session();
let (_other, _) = session_needing_you("Tabs?");
wait_for_indicator(&zellij, "the item is counted", "● 1");
let grid_snapshot = open_inbox_on(&zellij, "Tabs?");
click(&zellij,... |
rust_dataset_chunk_512191 | rust_dataset.txt | 512,191 | 512 | && !grid_snapshot.contains("Question number 6?")
},
);
zellij.quit();
}
#[test]
fn question_mark_opens_all_keys_from_the_inbox_and_escape_closes_it() {
let (mut zellij, _) = main_session_sized(TALL);
let (other, _) = session_needing_you("All keys?");
let other_row = row_of("... |
rust_dataset_chunk_512192 | rust_dataset.txt | 512,192 | 512 | );
let grid_snapshot = zellij.wait_until("the all keys screen is shown", |grid_snapshot| {
grid_snapshot.contains("All keys") && grid_snapshot.contains("<Ctrl l>")
});
for key in ["<Ctrl l>", "<Ctrl r>", "<Del>"] {
assert!(
grid_snapshot.contains(key),
"{} is missing ... |
rust_dataset_chunk_512193 | rust_dataset.txt | 512,193 | 512 | ENTION_CONFIG, SESSIONS_HELP, TYPE_INTO_IT,
TYPING_INTO,
};
use zellij_integration_tests::{
claim_first_terminal_and_wait_for_prompt, keys, BackgroundTestSession, FakePtyHandle,
GridSnapshot, LayoutInfo, Size, TestClient, TestRunner, TestSession, TERMINAL_SIZE,
};
use zellij_utils::attention::PEER_SCAN_INTE... |
rust_dataset_chunk_512194 | rust_dataset.txt | 512,194 | 512 | .disable_echo();
terminal.output(format!("$ {}\r\n", shown).as_bytes());
terminal.output(&needs_you(question));
(background, terminal)
}
fn wait_for_count(zellij: &TestSession, count: usize) {
let text = format!("● {}", count);
zellij.wait_until("the items are counted", |grid_snapshot| {
gr... |
rust_dataset_chunk_512195 | rust_dataset.txt | 512,195 | 512 | !("mirrored {}x{}", cols, rows)
}
#[test]
fn opening_the_browser_on_an_item_of_another_session_shows_its_pane_live() {
let (mut zellij, _) = main_session();
let (other, terminal) = item_session("$ first line here", "Live view?");
wait_for_count(&zellij, 1);
open_inbox_on(&zellij, "Live view?");
let... |
rust_dataset_chunk_512196 | rust_dataset.txt | 512,196 | 512 | _snapshot.text
);
wait_for_the_view_of(&zellij, &other, "watched pane output");
watcher.send_action(Action::WatchPane);
zellij.wait_until("the row goes once the watch ends", |grid_snapshot| {
!shows_watched_row(grid_snapshot, other.session_name()) && shows_inbox(grid_snapshot)
});
zellij... |
rust_dataset_chunk_512197 | rust_dataset.txt | 512,197 | 512 | wait_for_the_view_of(&zellij, &older, "pane of the older item");
assert!(
!zellij.main_client().has_exited(),
"the first click went to the pane"
);
zellij.send_stdin(&keys::sgr_click(column + 3, row));
let (switch, _previous) = zellij.follow_switch_into(older);
assert_eq!(switch.pan... |
rust_dataset_chunk_512198 | rust_dataset.txt | 512,198 | 512 | zellij.wait_until("a click outside returns to the list", |grid_snapshot| {
!grid_snapshot.contains(TYPING_INTO) && shows_inbox(grid_snapshot)
});
assert!(
terminal.stdin_bytes().ends_with(b"hello"),
"the release key reached the source: {:?}",
String::from_utf8_lossy(&terminal.st... |
rust_dataset_chunk_512199 | rust_dataset.txt | 512,199 | 512 | wait_until("the source view shows the barrier", |grid_snapshot| {
grid_snapshot.contains(barrier)
});
assert!(
!grid_snapshot.contains("mirrored "),
"the source pane is pinned:\n{}",
grid_snapshot.text
);
assert_eq!(terminal.size(), Some(layout_size));
}
#[test]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.