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_512400 | rust_dataset.txt | 512,400 | 512 | ENTER);
let grid_snapshot = zellij.wait_until("focused pane swapped to the left", |grid_snapshot| {
appears_in_order(grid_snapshot, &["BBB", "AAA"]) && grid_snapshot.status_bar_appears()
});
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn move_pane_backwards_swaps_wit... |
rust_dataset_chunk_512401 | rust_dataset.txt | 512,401 | 512 | let lower_terminal = split_down_and_wait_for_prompt(&zellij);
upper_terminal.output(b"AAA");
lower_terminal.output(b"BBB");
zellij.wait_until("both panes labelled top to bottom", |grid_snapshot| {
appears_in_order(grid_snapshot, &["AAA", "BBB"])
});
zellij.send_stdin(&keys::ctrl('h'));
... |
rust_dataset_chunk_512402 | rust_dataset.txt | 512,402 | 512 | () {
let mut zellij = start_zellij();
claim_first_terminal_and_wait_for_prompt(&zellij);
split_right_and_wait_for_prompt(&zellij);
zellij.send_stdin(&keys::alt('h'));
let grid_snapshot = zellij.wait_until("focus moved to the left pane", |grid_snapshot| {
grid_snapshot.status_bar_appears() ... |
rust_dataset_chunk_512403 | rust_dataset.txt | 512,403 | 512 | (62).row(2));
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn split_pane_downward() {
let mut zellij = start_zellij();
claim_first_terminal_and_wait_for_prompt(&zellij);
zellij.send_stdin(&keys::ctrl('p'));
zellij.send_stdin(&keys::key('d'));
let grid_snapshot = s... |
rust_dataset_chunk_512404 | rust_dataset.txt | 512,404 | 512 | ", |grid_snapshot| {
grid_snapshot.status_bar_appears() && grid_snapshot.cursor_is_at(col(62).row(2))
});
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn switch_focus_in_pane_mode() {
let mut zellij = start_zellij();
claim_first_terminal_and_wait_for_prompt(&zellij... |
rust_dataset_chunk_512405 | rust_dataset.txt | 512,405 | 512 | #1")
&& grid_snapshot.contains("Pane #2")
&& !grid_snapshot.contains("┌")
});
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn toggle_frames_with_single_pane() {
let mut zellij = start_zellij();
claim_first_terminal_and_wait_for_prompt(&zellij);
... |
rust_dataset_chunk_512406 | rust_dataset.txt | 512,406 | 512 | },
);
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn toggle_frames_with_stacked_panes() {
let mut zellij = start_zellij();
claim_first_terminal_and_wait_for_prompt(&zellij);
zellij.send_stdin(&keys::ctrl('p'));
zellij.send_stdin(&keys::key('s'));
spawn_secon... |
rust_dataset_chunk_512407 | rust_dataset.txt | 512,407 | 512 | ));
zellij.quit();
}
--- FILE: zellij/zellij-integration-tests/tests/paste_read.rs ---
#![cfg(unix)]
use zellij_integration_tests::{
claim_first_terminal_and_wait_for_prompt, start_zellij, FakePtyHandle, TestRunner, TestSession,
TERMINAL_SIZE,
};
const CLIPBOARD_READ_QUERY: &[u8] = b"\x1b]52;c;?\x1b\\";... |
rust_dataset_chunk_512408 | rust_dataset.txt | 512,408 | 512 | read must never reach the host terminal"
);
let pane_stdin = terminal.stdin_bytes();
assert!(
!contains_subslice(&pane_stdin, b"\x1b]52;"),
"no clipboard reply may be synthesised for the pane: {:?}",
pane_stdin
);
zellij.quit();
}
#[test]
fn a_clipboard_read_is_forwarded_... |
rust_dataset_chunk_512409 | rust_dataset.txt | 512,409 | 512 | |stdin_bytes| {
contains_subslice(stdin_bytes, CLIPBOARD_REPLY)
});
zellij.send_stdin(LATE_CLIPBOARD_REPLY);
zellij.send_stdin(b"z");
let pane_stdin = terminal.wait_for_stdin(
"a keystroke sent after the late reply still reached the pane",
|stdin_bytes| stdin_bytes.contains(&b... |
rust_dataset_chunk_512410 | rust_dataset.txt | 512,410 | 512 | ellij.wait_until("the fixture plugin is running", |grid_snapshot| {
!grid_snapshot.contains(PERMISSION_PROMPT)
&& grid_snapshot.contains("Rows:")
&& grid_snapshot.status_bar_appears()
});
zellij
}
fn write_into(zellij: &TestSession, session: &str, terminal: &FakePtyHandle) -> Cl... |
rust_dataset_chunk_512411 | rust_dataset.txt | 512,411 | 512 | ();
}
--- FILE: zellij/zellij-integration-tests/tests/plugin_prompt.rs ---
#![cfg(unix)]
use zellij_integration_tests::{
keys, CliCaller, GridSnapshot, LayoutInfo, TestRunner, TestSession, TERMINAL_SIZE,
};
use zellij_utils::cli::CliAction;
const FIXTURE_PLUGIN_PATH: &str = concat!(
env!("CARGO_MANIFEST_DIR... |
rust_dataset_chunk_512412 | rust_dataset.txt | 512,412 | 512 | pipe = CliAction::Pipe {
name: Some(name.to_owned()),
payload: None,
args,
plugin: Some(fixture_plugin_url()),
plugin_configuration: None,
force_launch_plugin: false,
skip_plugin_cache: false,
floating_plugin: None,
in_place_plugin: None,
... |
rust_dataset_chunk_512413 | rust_dataset.txt | 512,413 | 512 | ground(start + 13, row), plain_color);
assert_eq!(line.matches("Delete branch?").count(), 1);
zellij.send_stdin(&keys::ENTER);
wait_for_result(&zellij, "Confirmed(true)");
zellij.quit();
}
#[test]
fn confirm_no_reaches_the_plugin() {
let mut zellij = start_with_the_fixture_plugin();
ask(&zellij... |
rust_dataset_chunk_512414 | rust_dataset.txt | 512,414 | 512 | ();
}
#[test]
fn a_timeout_with_a_default_answers_the_default() {
let mut zellij = start_with_the_fixture_plugin();
send_to_the_fixture(&zellij, "prompt_input_timeout", &[("default", "fallback")]);
wait_for_prompt_showing(&zellij, "Name");
wait_for_result(&zellij, r#"TimedOut(Some(Text("fallback")))"#)... |
rust_dataset_chunk_512415 | rust_dataset.txt | 512,415 | 512 | /zellij-integration-tests/tests/plugins.rs ---
#![cfg(unix)]
use insta::assert_snapshot;
use zellij_integration_tests::{normalized, TestRunner, TERMINAL_SIZE};
fn load_background_plugin_config() -> String {
let plugin_path = format!(
"{}/../zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm",
... |
rust_dataset_chunk_512416 | rust_dataset.txt | 512,416 | 512 | from_pane(terminal.terminal_id())
}
fn wait_for_prompt_showing(zellij: &TestSession, text: &str) -> GridSnapshot {
zellij.wait_until(&format!("prompt showing {:?}", text), |grid_snapshot| {
grid_snapshot.contains(PROMPT_MARKER) && grid_snapshot.contains(text)
})
}
fn wait_for_prompts_to_close(zellij: ... |
rust_dataset_chunk_512417 | rust_dataset.txt | 512,417 | 512 | = confirm(&zellij, &terminal, "Force push?");
wait_for_prompt_showing(&zellij, "Force push?");
zellij.send_stdin(&keys::ESC);
answered(&prompt.wait_for_exit(), 1, "");
wait_for_prompts_to_close(&zellij);
zellij.quit();
}
#[test]
fn choose_from_piped_stdin_prints_the_chosen_line() {
let (mut ze... |
rust_dataset_chunk_512418 | rust_dataset.txt | 512,418 | 512 | "b"], from(&terminal));
wait_for_prompt_showing(&zellij, "0 ticked");
zellij.send_stdin(&keys::ENTER);
answered(&prompt.wait_for_exit(), 0, "");
zellij.quit();
}
#[test]
fn choose_shows_slow_input_as_it_arrives() {
let (mut zellij, terminal) = start_with_terminal();
let (stdin, stdin_receiver)... |
rust_dataset_chunk_512419 | rust_dataset.txt | 512,419 | 512 | (&keys::ENTER);
zellij.wait_until("validation error shown", |grid_snapshot| {
grid_snapshot.contains("Must match")
});
assert!(!prompt.has_exited());
for _ in 0..3 {
zellij.send_stdin(&[0x7f]);
}
type_text(&zellij, "good");
zellij.wait_until("error cleared", |grid_snapshot| {... |
rust_dataset_chunk_512420 | rust_dataset.txt | 512,420 | 512 | SPACE);
zellij.send_stdin(&keys::ctrl('a'));
answered(
&prompt.wait_for_exit(),
0,
"{\"name\":\"demo\",\"license\":\"MIT\",\"ci\":true,\"port\":8080,\"files\":[\"a\"]}\n",
);
zellij.quit();
}
#[test]
fn an_invalid_form_description_exits_two_without_a_popup() {
let (mut zelli... |
rust_dataset_chunk_512421 | rust_dataset.txt | 512,421 | 512 | !(!first.has_exited());
zellij.wait_until("first prompt back on top", |grid_snapshot| {
grid_snapshot.contains("First question?") && !grid_snapshot.contains("Second question?")
});
zellij.send_stdin(&keys::ESC);
answered(&first.wait_for_exit(), 1, "");
wait_for_prompts_to_close(&zellij);
... |
rust_dataset_chunk_512422 | rust_dataset.txt | 512,422 | 512 | _user_does_not_see_the_popup() {
let (mut zellij, terminal) = start_with_terminal();
let second_client = zellij.attach_client(TERMINAL_SIZE);
second_client.wait_until("second client loaded", |grid_snapshot| {
grid_snapshot.tab_bar_appears() && grid_snapshot.status_bar_appears()
});
let promp... |
rust_dataset_chunk_512423 | rust_dataset.txt | 512,423 | 512 | _owned()),
plugin_configuration: None,
force_launch_plugin: plugin.is_some(),
skip_plugin_cache: false,
floating_plugin: None,
in_place_plugin: None,
plugin_cwd: None,
plugin_title: None,
popup,
popup_no_focus: false,
popup_capture_all_keys... |
rust_dataset_chunk_512424 | rust_dataset.txt | 512,424 | 512 | _exit(), 1, "");
wait_for_prompts_to_close(&zellij);
zellij.quit();
}
#[test]
fn a_click_outside_a_pipe_popup_closes_it_with_popup_outside_click_close() {
let (mut zellij, terminal) = start_with_mouse_and_terminal();
let mut action = pipe_action(
"confirm",
None,
Some("zellij:pr... |
rust_dataset_chunk_512425 | rust_dataset.txt | 512,425 | 512 | zellij);
zellij.send_stdin(b"\x1b[<35;81;5M");
let prompt = zellij.run_prompt(&["choose", "--at-mouse", "pointer-item"], from(&terminal));
let grid_snapshot = wait_for_prompt_showing(&zellij, "pointer-item");
let (row, column) = column_of(&grid_snapshot, "pointer-item").unwrap();
assert!(
co... |
rust_dataset_chunk_512426 | rust_dataset.txt | 512,426 | 512 | prompt.wait_for_exit(), 0, "cursor-item\n");
zellij.quit();
}
fn frame_edges(grid_snapshot: &GridSnapshot, needle: &str) -> (usize, usize, usize) {
let (row, column) = column_of(grid_snapshot, needle).unwrap();
let line = &grid_snapshot.lines()[row];
let chars: Vec<char> = line.chars().collect();
l... |
rust_dataset_chunk_512427 | rust_dataset.txt | 512,427 | 512 | "CENTER-ITEM");
let (_, left, right) = frame_edges(&grid_snapshot, "CENTER-ITEM");
assert!(
left < 60 && right > 60,
"popup not centered: {}..{}",
left,
right
);
assert!((left + right) / 2 >= 55 && (left + right) / 2 <= 65);
close_with_esc(&zellij, prompt);
zelli... |
rust_dataset_chunk_512428 | rust_dataset.txt | 512,428 | 512 | .run_prompt(
&["menu", "--item", "o=Open file", "--item", "rm=Delete file"],
from(&terminal),
);
wait_for_prompt_showing(&zellij, "Delete file");
zellij.send_stdin(DOWN);
zellij.send_stdin(&keys::ENTER);
answered(&prompt.wait_for_exit(), 0, "rm\n");
zellij.quit();
}
#[test]
fn n... |
rust_dataset_chunk_512429 | rust_dataset.txt | 512,429 | 512 | in(&[0x7f]);
zellij.send_stdin(&keys::ENTER);
answered(&prompt.wait_for_exit(), 0, "4\n");
zellij.quit();
}
#[test]
fn toggle_shows_the_label_above_the_switch_inside_an_unbroken_frame() {
let (mut zellij, terminal) = start_with_terminal();
let prompt = zellij.run_prompt(&["toggle", "Enable CI"], fr... |
rust_dataset_chunk_512430 | rust_dataset.txt | 512,430 | 512 | from(&terminal).with_stdin_text(&lines));
zellij.wait_until("all lines read", |grid_snapshot| {
grid_snapshot.contains("./dir/00000") && !grid_snapshot.contains("reading")
});
assert!(!prompt.has_exited());
type_text(&zellij, "39999");
zellij.wait_until("last line found", |grid_snapshot| {
... |
rust_dataset_chunk_512431 | rust_dataset.txt | 512,431 | 512 | && grid_snapshot.contains(PROMPT_MARKER)
});
zellij.send_stdin(&keys::ctrl('p'));
zellij.wait_until("pane mode with the prompt open", |grid_snapshot| {
grid_snapshot.contains("PANE")
&& !grid_snapshot.contains("LOCK")
&& grid_snapshot.contains(PROMPT_MARKER)
});
zel... |
rust_dataset_chunk_512432 | rust_dataset.txt | 512,432 | 512 | , "Leave?");
zellij.send_stdin(&keys::ctrl('t'));
zellij.send_stdin(&keys::key('1'));
answered(&prompt.wait_for_exit(), 1, "");
wait_for_prompts_to_close(&zellij);
zellij.quit();
}
#[test]
fn detaching_with_keys_closes_the_prompt_popup() {
let (mut zellij, terminal) = start_with_terminal();
... |
rust_dataset_chunk_512433 | rust_dataset.txt | 512,433 | 512 | u{1b}[<0;{};{}M", close_column + 1, close_row + 1).as_bytes());
zellij.send_stdin(format!("\u{1b}[<0;{};{}m", close_column + 1, close_row + 1).as_bytes());
zellij.wait_until("notice closed by its close mark", |grid_snapshot| {
!grid_snapshot.contains("Build finished") && grid_snapshot.status_bar_appears... |
rust_dataset_chunk_512434 | rust_dataset.txt | 512,434 | 512 | pears());
zellij.quit();
}
#[test]
fn clicking_a_notice_focuses_the_pane_that_sent_it_and_closes_the_notice() {
let (mut zellij, left_terminal) = start_with_mouse();
let right_terminal = split_right_and_wait_for_prompt(&zellij);
let notice = zellij.run_prompt(&["notify", "Left pane is done"], from(&lef... |
rust_dataset_chunk_512435 | rust_dataset.txt | 512,435 | 512 | pty_spawn();
second_terminal.output(PROMPT);
zellij.wait_until("second tab opened", |grid_snapshot| {
grid_snapshot.contains("Tab #2") && grid_snapshot.status_bar_appears()
});
zellij.send_stdin(&keys::key('x'));
second_terminal.wait_for_stdin("user is active in the second tab", |bytes| {
... |
rust_dataset_chunk_512436 | rust_dataset.txt | 512,436 | 512 | unwrap();
let lines = grid_snapshot.lines();
for row in text_row + 1..(text_row + 3).min(lines.len()) {
let below: String = lines[row]
.chars()
.skip(text_column.saturating_sub(2))
.take("No sender".len() + 4)
.collect();
assert!(
!belo... |
rust_dataset_chunk_512437 | rust_dataset.txt | 512,437 | 512 | = zellij.wait_until("second notice shown", |grid_snapshot| {
grid_snapshot.contains("Tab hidden")
});
assert_eq!(lines_containing(&grid_snapshot, "Builds"), 2);
assert_eq!(lines_containing(&grid_snapshot, "compiler"), 2);
zellij.quit();
}
#[test]
fn a_title_set_by_a_program_in_another_tab_upda... |
rust_dataset_chunk_512438 | rust_dataset.txt | 512,438 | 512 | });
zellij.quit();
}
--- FILE: zellij/zellij-integration-tests/tests/render_cadence.rs ---
#![cfg(unix)]
use std::sync::{Mutex, MutexGuard};
use std::thread::sleep;
use std::time::Duration;
use zellij_integration_tests::client_screen::render_bytes;
use zellij_integration_tests::{
claim_first_terminal_and... |
rust_dataset_chunk_512439 | rust_dataset.txt | 512,439 | 512 | .contains("ALT-END")
});
assert!(grid_snapshot.contains("alt screen row 00"));
assert!(grid_snapshot.contains("alt screen row 09"));
zellij.quit();
}
#[test]
fn a_redraw_split_across_pty_reads_is_never_shown_half_done() {
let (tap_tx, tap_rx) = crossbeam::channel::unbounded::<Vec<u8>>();
let mu... |
rust_dataset_chunk_512440 | rust_dataset.txt | 512,440 | 512 | });
assert!(
immediate_render_requests() > before,
"the echo of a typed character waited for the render quiet period"
);
zellij.quit();
}
#[test]
fn a_redraw_arriving_after_the_echo_window_keeps_the_quiet_period_and_is_never_shown_half_done() {
let _count_owner = own_immediate_rende... |
rust_dataset_chunk_512441 | rust_dataset.txt | 512,441 | 512 | egration-tests/tests/rendering_width.rs ---
#![cfg(unix)]
use insta::assert_snapshot;
use zellij_integration_tests::{
claim_first_terminal_and_wait_for_prompt, normalized, start_zellij, FakePtyHandle,
HostTerminal, TestRunner, TestSession, TERMINAL_SIZE,
};
const SENTINEL: &str = "FIXTURE-END";
fn render_fix... |
rust_dataset_chunk_512442 | rust_dataset.txt | 512,442 | 512 | _wait_for_prompt(&zellij);
let rendered = render_fixture(&zellij, &terminal, EMOJI_SEQUENCES);
assert_snapshot!(rendered);
zellij.quit();
}
#[test]
fn emoji_sequences_render_as_one_unit_each_by_default_on_a_cluster_aware_host() {
let mut zellij = TestRunner::new(TERMINAL_SIZE)
.with_host_termin... |
rust_dataset_chunk_512443 | rust_dataset.txt | 512,443 | 512 | {251c}\u{2500}\u{253c}\u{2500}\u{2524}\r\n\u{2514}\u{2500}\u{2534}\u{2500}\u{2518}\r\n\u{2554}\u{2550}\u{2557}\u{2588}\u{2589}\u{258a}",
);
assert_snapshot!(rendered);
zellij.quit();
}
#[test]
fn wide_character_straddling_the_right_edge_wraps_whole() {
let mut zellij = start_zellij();
let terminal ... |
rust_dataset_chunk_512444 | rust_dataset.txt | 512,444 | 512 | ());
terminal.output(format!("\u{1b}[4;1H{}", SENTINEL).as_bytes());
let grid_snapshot = zellij.wait_until("erased wide character rendered", |grid_snapshot| {
grid_snapshot.contains(SENTINEL) && grid_snapshot.status_bar_appears()
});
let lines = grid_snapshot.lines();
assert!(
lines[... |
rust_dataset_chunk_512445 | rust_dataset.txt | 512,445 | 512 | u{17a4}|",
);
assert_snapshot!(rendered);
zellij.quit();
}
--- FILE: zellij/zellij-integration-tests/tests/resize.rs ---
#![cfg(unix)]
use insta::assert_snapshot;
use zellij_integration_tests::{
claim_first_terminal_and_wait_for_prompt, col, keys, normalized,
split_down_and_wait_for_prompt, split... |
rust_dataset_chunk_512446 | rust_dataset.txt | 512,446 | 512 | (zellij: &TestSession) -> usize {
pane_two_header_row(&zellij.snapshot()).expect("horizontal pane boundary rendered")
}
#[test]
fn resize_increase_right() {
let mut zellij = start_zellij();
let left_terminal = claim_first_terminal_and_wait_for_prompt(&zellij);
split_right_and_wait_for_prompt(&zellij);
... |
rust_dataset_chunk_512447 | rust_dataset.txt | 512,447 | 512 | _| cols < initial_cols);
let grid_snapshot = zellij.wait_until("pane boundary moved left", |grid_snapshot| {
grid_snapshot.status_bar_appears()
&& pane_two_header_column(grid_snapshot).is_some_and(|column| column < initial_boundary)
});
assert_snapshot!(normalized(&grid_snapshot));
... |
rust_dataset_chunk_512448 | rust_dataset.txt | 512,448 | 512 | let initial_boundary = horizontal_boundary_row(&zellij);
resize_in_resize_mode(&zellij, &keys::key('J'));
upper_terminal.wait_for_size("upper terminal shrank", |_, rows| rows < initial_rows);
let grid_snapshot = zellij.wait_until("pane boundary moved up", |grid_snapshot| {
grid_snapshot.status_ba... |
rust_dataset_chunk_512449 | rust_dataset.txt | 512,449 | 512 | _for_prompt(&zellij);
let initial_cols = width(&right_terminal, "right terminal initial width");
let initial_boundary = vertical_boundary_column(&zellij);
resize_in_resize_mode(&zellij, &keys::key('-'));
right_terminal.wait_for_size("right terminal shrank", |cols, _| cols < initial_cols);
let grid... |
rust_dataset_chunk_512450 | rust_dataset.txt | 512,450 | 512 | ;
use zellij_integration_tests::{
keys, normalized, LayoutInfo, TestRunner, TestSession, PROMPT, TERMINAL_SIZE,
};
const RESURRECT_LAYOUT: &str = r#"
layout {
default_tab_template {
pane size=1 borderless=true {
plugin location="tab-bar"
}
children
pane size=1 border... |
rust_dataset_chunk_512451 | rust_dataset.txt | 512,451 | 512 | port true")
.start();
let terminal = zellij.expect_pty_spawn();
terminal.output(b"VIEWPORT_CONTENT_TO_RESTORE\n");
zellij.wait_until(
"pane content rendered before serialization",
|grid_snapshot| {
grid_snapshot.contains("VIEWPORT_CONTENT_TO_RESTORE")
&& g... |
rust_dataset_chunk_512452 | rust_dataset.txt | 512,452 | 512 | ellij.send_stdin(&keys::key('h'));
zellij.send_stdin(&keys::key('x'));
let grid_snapshot = zellij.wait_until("the first pane is closed", |grid_snapshot| {
grid_snapshot.text.matches("Pane #").count() < 3
});
assert_eq!(
grid_snapshot.row_of_line("Tab #1"),
Some(0),
"tab ... |
rust_dataset_chunk_512453 | rust_dataset.txt | 512,453 | 512 | Session {
let config = format!(
r#"
keybinds {{
shared {{
bind "Alt y" {{
Run "sh" "-c" "env > \"$1.tmp\" && mv \"$1.tmp\" \"$1\"" "sh" "{}" {{
background true;
}};
}}
bind "Al... |
rust_dataset_chunk_512454 | rust_dataset.txt | 512,454 | 512 | _dir = tempfile::tempdir().unwrap();
let env_file = temp_dir.path().join("env");
let mut zellij = start_with_background_binding(&env_file);
claim_first_terminal_and_wait_for_prompt(&zellij);
zellij.send_stdin(&keys::ctrl('o'));
zellij.send_stdin(&keys::key('a'));
zellij.wait_until("about plugin ... |
rust_dataset_chunk_512455 | rust_dataset.txt | 512,455 | 512 | assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn page_scroll_down() {
let mut zellij = start_zellij();
fill_pane_past_viewport(&zellij);
zellij.send_stdin(&keys::ctrl('s'));
zellij.send_stdin(&keys::ctrl('b'));
zellij.wait_until("scrolled up by a page", |grid_snapshot... |
rust_dataset_chunk_512456 | rust_dataset.txt | 512,456 | 512 | () {
let mut zellij = start_zellij();
fill_pane_past_viewport(&zellij);
zellij.send_stdin(&keys::ctrl('s'));
zellij.send_stdin(&keys::key('k'));
zellij.send_stdin(&keys::key('k'));
zellij.wait_until("scrolled up two lines", |grid_snapshot| {
grid_snapshot.contains("SCROLL 2/")
});
... |
rust_dataset_chunk_512457 | rust_dataset.txt | 512,457 | 512 | grid_snapshot.contains("SCROLL 4/")
&& !grid_snapshot.contains(LAST_LINE)
},
);
assert_snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn focusing_a_scrolled_pane_re_enters_scroll_mode_at_the_same_offset() {
let mut zellij = start_zellij();
let upper_termina... |
rust_dataset_chunk_512458 | rust_dataset.txt | 512,458 | 512 | _SIZE,
};
fn start_zellij_with_full_frames() -> TestSession {
TestRunner::new(TERMINAL_SIZE)
.with_config("pane_frame_style \"full\"")
.start()
}
fn enter_search_on_visible_match_with_full_frames(zellij: &TestSession) {
let terminal = zellij.expect_pty_spawn();
terminal.output(b"NEEDLE on ... |
rust_dataset_chunk_512459 | rust_dataset.txt | 512,459 | 512 | .wait_until("upper match initially off screen", |grid_snapshot| {
grid_snapshot.contains("line40") && !grid_snapshot.contains("line05")
});
zellij.send_stdin(&keys::ctrl('s'));
zellij.send_stdin(&keys::key('s'));
zellij.wait_until("search input mode active", |grid_snapshot| {
grid_snaps... |
rust_dataset_chunk_512460 | rust_dataset.txt | 512,460 | 512 | _snapshot!(normalized(&grid_snapshot));
zellij.quit();
}
#[test]
fn search_toggle_case_sensitivity() {
let mut zellij = start_zellij_with_full_frames();
enter_search_on_visible_match_with_full_frames(&zellij);
zellij.send_stdin(&keys::key('c'));
let grid_snapshot = zellij.wait_until("case sensiti... |
rust_dataset_chunk_512461 | rust_dataset.txt | 512,461 | 512 | "$ ");
zellij.wait_until("the session is drawn", |grid_snapshot| {
grid_snapshot.cursor_is_at(col(2).row(1))
});
(zellij, terminal)
}
fn wait_for_indicator(zellij: &TestSession, what: &str, text: &str) {
zellij.wait_until(what, |grid_snapshot| {
grid_snapshot
.lines()
... |
rust_dataset_chunk_512462 | rust_dataset.txt | 512,462 | 512 | > = line.chars().collect();
let first = chars.iter().position(|c| *c == '│')?;
let last = chars.iter().rposition(|c| *c == '│')?;
if last > first + 1 {
Some(chars[first + 1..last].iter().collect())
} else {
None
}
}
fn help_has_blank_rows_around_it(grid_snapshot: &GridSnapshot) -> b... |
rust_dataset_chunk_512463 | rust_dataset.txt | 512,463 | 512 | x1b]133;A\x1b\\$ \x1b]133;B\x1b\\make\x1b]133;C\x1b\\\r\n");
long_numbered_lines(&terminal, "res", 20);
terminal.output(&needs_you("Look at the end?"));
wait_for_indicator(&zellij, "the item is counted", "● 1");
open_live_view_of(&zellij, "Look at the end?");
zellij.wait_until(
"the live vie... |
rust_dataset_chunk_512464 | rust_dataset.txt | 512,464 | 512 | ", |grid_snapshot| {
tab_line(grid_snapshot).contains("<TAB> switch")
});
wide.quit();
let (mut narrow, _) = main_session_sized(Size { cols: 38, rows: 24 });
narrow.send_stdin(&keys::INBOX_KEY);
narrow.wait_until("the narrow panel shows the short hint", |grid_snapshot| {
let line = t... |
rust_dataset_chunk_512465 | rust_dataset.txt | 512,465 | 512 | });
let (output_column, _) = grid_snapshot.position_of("some output").unwrap();
let (item_column, _) = grid_snapshot.position_of(&row).unwrap();
assert!(
output_column > item_column + row.chars().count(),
"the live view is not beside the list:\n{}",
grid_snapshot.text
);
wid... |
rust_dataset_chunk_512466 | rust_dataset.txt | 512,466 | 512 | .iter()
.rposition(|c| *c != ' ')
.unwrap();
let left_margin = block_left - frame_left - 1;
let right_margin = frame_right - block_right - 1;
assert!(
left_margin.abs_diff(right_margin) <= 1,
"the block is not centred across ({} columns left, {} right):\n{}",
left_ma... |
rust_dataset_chunk_512467 | rust_dataset.txt | 512,467 | 512 | inbox opens", |grid_snapshot| {
shows_inbox(grid_snapshot)
});
for _ in 0..6 {
zellij.send_stdin(&keys::UP);
}
let top = zellij.wait_until("at the top only the lower marker shows", |grid_snapshot| {
more_marker(grid_snapshot, "↑").is_none() && more_marker(grid_snapshot, "↓").is_... |
rust_dataset_chunk_512468 | rust_dataset.txt | 512,468 | 512 | .map(|name| WindowState {
session: Some((*name).to_owned()),
})
.collect(),
..Default::default()
};
let (requests, received) = mpsc::channel();
std::thread::spawn(move || {
use interprocess::local_socket::prelude::*;
for stream in listener.inc... |
rust_dataset_chunk_512469 | rust_dataset.txt | 512,469 | 512 | |grid_snapshot| selected_session_line(grid_snapshot, other) && grid_snapshot.contains(help),
);
}
fn confirm_warning(zellij: &TestSession, detaching: bool) {
let warning = zellij.wait_until("the warning is shown", |grid_snapshot| {
grid_snapshot.contains("You are connected from a terminal")
});
... |
rust_dataset_chunk_512470 | rust_dataset.txt | 512,470 | 512 | (QUIET).is_err());
zellij.quit();
}
#[test]
fn alt_w_on_a_typed_name_creates_that_session_in_a_new_window() {
let other = other_session();
let requests = fake_desktop_app(&[]);
let mut zellij = main_session();
open_sessions_tab(&zellij, other.session_name());
zellij.send_stdin(b"brand-new");
... |
rust_dataset_chunk_512471 | rust_dataset.txt | 512,471 | 512 | _snapshot| {
grid_snapshot.contains("Inbox (1)") && grid_snapshot.contains("Deploy now?")
});
zellij.send_stdin(&keys::alt('w'));
confirm_warning(&zellij, false);
let request = open_window(&requests);
assert_eq!(request.session.as_deref(), Some(other.session_name()));
assert!(!request.cr... |
rust_dataset_chunk_512472 | rust_dataset.txt | 512,472 | 512 | iter()
.any(|message| message == "Exit"));
zellij.wait_until("the switched client is attached", |grid_snapshot| {
grid_snapshot.status_bar_appears()
});
zellij.quit();
}
fn other_session_needing_you(text: &str) -> (BackgroundTestSession, FakePtyHandle) {
let other = TestRunner::new(TERM... |
rust_dataset_chunk_512473 | rust_dataset.txt | 512,473 | 512 | -layout"));
assert!(request.create);
assert!(request.layout.is_some(), "the chosen layout is sent");
assert!(
!zellij.main_client().has_exited(),
"plain keys keep this terminal"
);
zellij.quit();
}
#[test]
fn alt_x_in_the_inbox_switches_to_the_items_pane_and_disconnects_the_other_cl... |
rust_dataset_chunk_512474 | rust_dataset.txt | 512,474 | 512 | _snapshot = zellij.wait_until("this client is on the item's tab", |grid_snapshot| {
grid_snapshot.status_bar_appears() && !grid_snapshot.contains("<c> dismiss")
});
assert!(
!zellij.main_client().has_exited(),
"this client stays:\n{}",
grid_snapshot.text
);
zellij.quit();... |
rust_dataset_chunk_512475 | rust_dataset.txt | 512,475 | 512 | ellij.wait_until("alt d still warns", warning_is_shown);
zellij.send_stdin(&keys::ESC);
zellij.wait_until("the warning is dismissed", |grid_snapshot| {
!warning_is_shown(grid_snapshot)
});
assert!(requests.recv_timeout(QUIET).is_err());
zellij.send_stdin(&keys::alt('d'));
confirm_warning... |
rust_dataset_chunk_512476 | rust_dataset.txt | 512,476 | 512 | for the session to be renamed to {:?}",
new_name
);
std::thread::sleep(Duration::from_millis(20));
}
// The socket / pipe was NOT renamed: the new name resolves to the exact same
// path the old name did.
let pipe_after = resolve_session_socket_path(new_name)
.expec... |
rust_dataset_chunk_512477 | rust_dataset.txt | 512,477 | 512 | in(&keys::key('r'));
zellij.wait_until("the session name is cleared", |grid_snapshot| {
grid_snapshot.contains("(Enter name...)")
});
let new_name = "renamed-with-keys";
for character in new_name.chars() {
zellij.send_stdin(&keys::key(character));
}
zellij.wait_until("the draft i... |
rust_dataset_chunk_512478 | rust_dataset.txt | 512,478 | 512 | |grid_snapshot| {
grid_snapshot.contains(&format!("({})", old_name))
});
assert!(resolve_session_socket_path("never-applied").is_none());
assert!(resolve_session_socket_path(&old_name).is_some());
}
#[test]
fn a_rejected_session_rename_shows_why_and_restores_the_name() {
let zellij = TestRunne... |
rust_dataset_chunk_512479 | rust_dataset.txt | 512,479 | 512 | ellij.send_stdin(&keys::ENTER);
zellij.wait_until(
"a popup says the name is taken and the old name is back",
|grid_snapshot| {
grid_snapshot.contains("Could not rename session")
&& grid_snapshot.contains("already exists")
&& grid_snapshot.contains(&format... |
rust_dataset_chunk_512480 | rust_dataset.txt | 512,480 | 512 | ]| {
zellij_utils::sessions::pane_session_from(
Some(id.to_owned()),
Some(old_name.clone()),
zellij_utils::session_index::session_name_for_id,
zellij_utils::session_index::session_id_for_name,
running,
)
};
assert_eq!(
resolve(&... |
rust_dataset_chunk_512481 | rust_dataset.txt | 512,481 | 512 | _TO_TYPE: &str = zellij_integration_tests::inbox::TYPE_INTO_IT_HINT;
const SNAPSHOT_SUMMARY: &str = "Clients attached";
const END: &[u8] = b"\x1b[F";
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct Area {
x: usize,
y: usize,
cols: usize,
rows: usize,
}
impl Area {
fn contains(&self, column: us... |
rust_dataset_chunk_512482 | rust_dataset.txt | 512,482 | 512 | let (x, y, cols, rows) = zellij_integration_tests::inbox::inbox_view_area(grid_snapshot)?;
Some(Area { x, y, cols, rows })
})
}
fn framed_view_area(grid_snapshot: &GridSnapshot, session: &str) -> Option<Area> {
let place = format!(" {} › ", session);
let lines = grid_snapshot.lines();
l... |
rust_dataset_chunk_512483 | rust_dataset.txt | 512,483 | 512 | ) -> Option<usize> {
grid_snapshot
.lines()
.iter()
.position(|line| line.contains(name) && !line.contains('┌') && !line.contains('└'))
}
fn shown_session(grid_snapshot: &GridSnapshot) -> Option<String> {
grid_snapshot.lines().iter().find_map(|line| {
let start = line.find('┌')?... |
rust_dataset_chunk_512484 | rust_dataset.txt | 512,484 | 512 | session: &BackgroundTestSession,
terminal: &FakePtyHandle,
text: &str,
) -> (u16, u16) {
let grid_snapshot = wait_for_the_view_of(zellij, session.session_name(), text);
let view_size = view_size_of(&grid_snapshot, session.session_name());
terminal.wait_for_size("the shown pane is resized once it... |
rust_dataset_chunk_512485 | rust_dataset.txt | 512,485 | 512 | _name()]);
select_session(&zellij, other.session_name());
wait_for_the_view_of(&zellij, other.session_name(), "first line here");
terminal.output(b"printed afterwards\r\n");
wait_for_the_view_of(&zellij, other.session_name(), "printed afterwards");
zellij.quit();
}
#[test]
fn selecting_a_tab_row_an... |
rust_dataset_chunk_512486 | rust_dataset.txt | 512,486 | 512 | zellij.send_stdin(END);
let grid_snapshot = zellij.wait_until("the saved preview is shown", |grid_snapshot| {
grid_snapshot.contains("┌ gone-one ") && grid_snapshot.contains("Folder:")
});
assert!(
!grid_snapshot.contains(CLICK_TO_TYPE),
"an exited session is shown live:\n{}",
... |
rust_dataset_chunk_512487 | rust_dataset.txt | 512,487 | 512 | ");
let (first_name, second_name) = (
first.session_name().to_owned(),
second.session_name().to_owned(),
);
open_the_sessions(&zellij, &[&first_name, &second_name]);
select_session(&zellij, &first_name);
wait_for_the_view_of(&zellij, &first_name, "first source");
let grid_snapsho... |
rust_dataset_chunk_512488 | rust_dataset.txt | 512,488 | 512 | && grid_snapshot.contains(CLICK_TO_TYPE)
});
zellij.send_stdin(b"x");
zellij.wait_until("keys go to the search field again", |grid_snapshot| {
!grid_snapshot.contains(CLICK_TO_TYPE)
});
assert!(
terminal.stdin_bytes().ends_with(b"hello"),
"the inbox key reached the pane: {:?... |
rust_dataset_chunk_512489 | rust_dataset.txt | 512,489 | 512 | assert_eq!(
sources[first].1.size_history(),
first_sizes,
"going back to a session the preview resized resized it again"
);
close_the_browser(&zellij);
for ((_, terminal, _), layout_size) in sources.iter().zip(layouts) {
terminal.wait_for_size(
"closing the brows... |
rust_dataset_chunk_512490 | rust_dataset.txt | 512,490 | 512 | item_terminal.wait_for_size("the item pane is resized again", |cols, rows| {
(cols, rows) == inbox_view_size
});
assert_eq!(plain_terminal.size(), Some(sessions_view_size));
let plain_sizes = plain_terminal.size_history();
zellij.send_stdin(&keys::TAB);
wait_for_the_view_of(&zellij, plai... |
rust_dataset_chunk_512491 | rust_dataset.txt | 512,491 | 512 | resized"
);
}
#[test]
fn alt_enter_types_into_the_shown_pane_and_stops_typing_with_or_without_kitty_encoding() {
let (mut zellij, _) = main_session();
let (other, terminal) = source_session("$ alt enter here");
let name = other.session_name();
open_the_sessions(&zellij, &[name]);
select_sessio... |
rust_dataset_chunk_512492 | rust_dataset.txt | 512,492 | 512 | 0], "the browsed pane");
let settled_sizes = terminals[0].size_history();
zellij.send_stdin(&keys::RIGHT);
zellij.wait_until("the session shows its tab", |grid_snapshot| {
grid_snapshot
.lines()
.iter()
.any(|line| line.contains("Tab #1 (2 panes)"))
});
ze... |
rust_dataset_chunk_512493 | rust_dataset.txt | 512,493 | 512 | str = "Inbox (";
const BROWSER_TABS: &str = "│ Sessions (";
const DONT_SHOW_AGAIN: &str = "Don't show again";
const PLACEHOLDER: &str = "—";
const EMPTY_INBOX_SECTION: &str = "Nothing in the inbox";
const SESSIONS_HELP: &str = "<F1> all keys";
const RESUME_LAYOUT: &str = r#"
layout {
pane size=1 borderless=true {
... |
rust_dataset_chunk_512494 | rust_dataset.txt | 512,494 | 512 | 1))
})
.expect("the text is on screen")
}
fn open_the_browser_with_the_inbox_key(zellij: &TestSession) {
zellij.send_stdin(&keys::INBOX_KEY);
zellij.wait_until("the inbox browser opened", |grid_snapshot| {
grid_snapshot.contains(BROWSER_TABS)
});
}
fn open_the_sessions_tab_with_th... |
rust_dataset_chunk_512495 | rust_dataset.txt | 512,495 | 512 |
}
fn wait_for_index_row(session_name: &str, what: &str, ready: impl Fn(&SessionRow) -> bool) {
let deadline = Instant::now() + default_timeout();
loop {
let row = SessionIndex::open_default()
.ok()
.and_then(|index| index.get(session_name).ok().flatten());
if row.as_ref... |
rust_dataset_chunk_512496 | rust_dataset.txt | 512,496 | 512 | q", "-b", branch]);
git(&["commit", "-q", "--allow-empty", "-m", "init"]);
folder
}
#[test]
fn card_shows_on_a_new_session_when_another_session_is_running() {
let _background = start_running_session_in_background();
let mut zellij = start_session_with_session_features();
claim_first_terminal_and_wa... |
rust_dataset_chunk_512497 | rust_dataset.txt | 512,497 | 512 | ::GLOBAL_PUBLISH_DEBOUNCE)
* 5,
);
let mut zellij = target.attach(TERMINAL_SIZE);
zellij.wait_until("the reattach card is shown", |grid_snapshot| {
grid_snapshot.contains("While you were away")
});
zellij.quit();
}
#[test]
fn card_is_not_shown_on_resume() {
let _other = star... |
rust_dataset_chunk_512498 | rust_dataset.txt | 512,498 | 512 | in("the command reached the terminal", |stdin| {
stdin.ends_with(b"\r")
});
wait_for_the_card_to_close(&zellij);
let grid_snapshot = zellij.wait_until("the indicator shows it is closed", |grid_snapshot| {
bar_says(grid_snapshot, "2 running ▾")
});
let (column, line) = position_of(&gr... |
rust_dataset_chunk_512499 | rust_dataset.txt | 512,499 | 512 | ession_serialization true",
SESSION_FEATURES_ON
))
.with_layout(LayoutInfo::Stringified(RESUME_LAYOUT.to_owned()))
.start();
zellij.expect_pty_spawn().output(PROMPT);
zellij.wait_until("session loaded", |grid_snapshot| {
grid_snapshot.tab_bar_appears() && grid_snapsho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.