T66: a dropped path stays literal for the session's own shell, as its name says: POSIX shells escape ^ and ~ too, which zsh's extendedglob reads; PowerShell, Windows' default, single-quotes it with its quotes doubled, so $, $( ) and ; stay text; cmd double-quotes it and refuses a %, which it expands inside quotes

This commit is contained in:
ZacharyZhang-NY committed 2026-10-19 16:51:51 -04:00
1 parent 545fb46249
commit 887378ade3
11 files changed
+159 -63

No files matched your search

+1 -1
View File
@@ -116,4 +116,4 @@ ELYTerminal. A terminal on GPUI and Ely components. `PRD.md` says what it does;
- 2026-10-19: Settings › Terminal checks for updates, which the owner asked for after 0.1.5: under Ely, a switch, on by default, checks at start and once a day, and Check now checks at once. The check runs `curl`, as git runs through its command line, so no HTTP or TLS crate joins the build; macOS and Windows 10 ship it, and a missing curl shows as a failed check. It asks Gitea's API for the latest published release, compares its tag's three numbers with the running version, and the row says what it found; a newer one brings Download, which opens the release's page in the browser, since replacing a running, signed app is a job of its own. An automatic check that finds one posts a system notification, at most once a day, whose press opens the page. Checks run off the main thread, one at a time, each start and finding logged; a failure shows its error in the row. Under Xorg's dummy screen the start's check found 0.1.5 the latest, Check now and the switch checked again, and a build named 0.1.4 showed 0.1.5 out with Download, which opened its page.
- 2026-10-19: the terminal shows a scrollbar, which a user asked for in issue #2 after 0.1.5: a program that tracks the mouse takes the wheel, so the wheel alone could not reach the history. A thumb rides the view's right edge, over the padding, in Ely's scrollbar sizes and colors, its thickness, its least length and the foreground at 22 and 42 percent; its length is the screen's share of the history, and its place where the view stands. A drag moves the view through the history, whatever mouse mode the program asked for; the bar covers the grid's hitbox, so the terminal sees none of its presses, and a release with no press of its own reports nothing. Ely's `Scrollbar` reads a gpui `ScrollHandle`, and the terminal's place is alacritty's display offset, so the bar is the terminal's own, drawn as Ely draws hers and dragged through gpui's drag as hers is; gpui sets a drag's anchor at its first move past the threshold, so a pointer that jumps far at once loses that jump. The alternate screen holds no history, so it shows none. Under Xorg's dummy screen, 500 lines in, a drag to the top showed the first prompt and lines 1 to 39, and with mouse tracking on, which sent the wheel to the program, the bar still scrolled.
- 2026-10-19: a plain click on the line the shell reads moves its cursor there, which a user asked for after 0.1.6, as Ghostty's `cursor-click-to-move`: a press with no modifier, one click, let go in its own cell with no selection, while OSC 133 says the shell reads a line, B since the last A or C, and the program tracks no mouse at the release. A shell whose prompt start says `click_events=1` or `2`, as fish from 4.1 says on its own, hears a click past the prompt's last cell before the cursor, or, where no prompt cell of its own line comes before the input, as under fish's empty prompt, from the first cell of the newest line typed, known by its number, not its place, since a prompt drawn at the screen's top leaves older lines below it, down to that line's last row or the cursor's, and never on a prompt cell, itself, a left press in SGR, its row the screen's or counted from the prompt's first, as kitty and Ghostty send it, and moves its own cursor, combining marks and its own redraws included: fish moves by code point, and its redraws drop the wrap flags a count would follow. Any other shell gets Left or Right arrows, one per cell, each pressed and let go as the keyboard would, through the key encoder, so DECCKM, kitty's flags and win32-input-mode shape them; the count runs only on the cursor's line, soft wraps joined, past the prompt's cells, which the prompt's link marks, so bash 3.2, which sends no C, moves nothing once its command left the prompt's line. Cells after the last character typed count only up to the cursor, so a click past the end goes to the end; a wide character takes one arrow. Never on the alternate screen. One line only, as Ghostty's `cl=line`. A right prompt or an autosuggestion past the typed text counts as text, as in Ghostty, so a click on it may take the suggestion. The first click of a double click moves the cursor before the word selects, as in Ghostty.
- 2026-10-19: files dropped on the terminal type their paths, which a user asked for after 0.1.6, as macOS Terminal does: each path followed by a space, the paths of one drop in its order, sent as a paste, bracketed when the program asked. On macOS and Linux each character a shell reads specially, Ghostty's list, gets a backslash; on Windows a path holding a space is wrapped in double quotes, as Windows Terminal wraps it. A path not in UTF-8, or holding a control character, which would act as it is typed, stops the drop, logged. gpui hands a drop to the hitbox under the pointer only while the last input was not the keyboard, and a file drag counts as no input of its own: after typing, a drop with no pointer move over the window since does nothing, and nothing in ELYTerminal sees it, which the owner chose to leave so. `shot`'s `drop@x,y` plays a drop through `Window::dispatch_event`, so AppKit's drag session itself goes untested.
- 2026-10-19: files dropped on the terminal type their paths, which a user asked for after 0.1.6, as macOS Terminal does: each path followed by a space, the paths of one drop in its order, sent as a paste, bracketed when the program asked, and kept literal for the shell the session started, which its name says, as the integration reads it: for sh, bash, zsh, fish and any other, each character Ghostty escapes gets a backslash, and `^` and `~` too, which zsh's `extendedglob` reads; for pwsh and powershell, the default on Windows, single quotes, each single quote inside doubled, PowerShell's curly ones too, since PowerShell reads a backslash as a plain character and expands `$` inside double quotes; for cmd, double quotes, which keep `&`, `|`, `<`, `>` and `^` inert, and a path holding `%`, which cmd expands inside them, stops the drop. Windows Terminal's quotes around a path with a space alone leave `$(...)` and `;` live in PowerShell. A program run inside the session, `cmd` under PowerShell among them, gets the session's own quoting. A path not in UTF-8, or holding a control character, which would act as it is typed, stops the drop, logged. gpui hands a drop to the hitbox under the pointer only while the last input was not the keyboard, and a file drag counts as no input of its own: after typing, a drop with no pointer move over the window since does nothing, and nothing in ELYTerminal sees it, which the owner chose to leave so. `shot`'s `drop@x,y` plays a drop through `Window::dispatch_event`, so AppKit's drag session itself goes untested.
+1 -1
View File
@@ -59,7 +59,7 @@ Ghostty is the bar for what the terminal does. ELYTerminal owns its engine on `a
- Mouse: select by character, word (double press) and line (triple press); Shift extends; mouse reporting (X10, normal, button, any; SGR and UTF-8); wheel scrolls back, or reports, or sends arrows on the alternate screen.
- Click to move: while the shell reads a line, as its OSC 133 marks say, a plain click on that line, past its prompt, moves the shell's cursor there, as Ghostty's `cursor-click-to-move`: a shell that takes clicks, as fish does, hears the click; others get arrow keys.
- Clipboard: copy, paste (bracketed when asked), copy on select per setting, OSC 52 writes.
- Drop: files dropped on the terminal type their paths at the cursor, as macOS Terminal does, each escaped for the shell, or quoted on Windows, and followed by a space.
- Drop: files dropped on the terminal type their paths at the cursor, as macOS Terminal does, each kept literal for the session's shell and followed by a space.
- Links: OSC 8 and plain URLs; Cmd-press (Ctrl-press off macOS) opens them. Inside herdr, while it takes the mouse, herdr opens them, web links only, as herdr does, whole where its pane wraps them, and underlines them while the key is held; with Shift the terminal opens what it sees.
- Focus reporting, title (OSC 0/2), scrollback limit per setting, find in scrollback (Ely's `FindWidget`).
- A scrollbar over the history, along the terminal's right edge: a drag on its thumb scrolls, whatever the program does with the wheel.
+6 -1
View File
@@ -5,7 +5,11 @@ fn main() {
use std::time::Duration;
use ely_gpui_component::Assets;
use elyterminal::{app, settings::window::SettingsWindow, term::Launch};
use elyterminal::{
app,
settings::window::SettingsWindow,
term::{Launch, Quote},
};
use gpui::AnyWindowHandle;
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("elyterminal=info"))
@@ -25,6 +29,7 @@ fn main() {
cwd: std::env::current_dir().expect("a current folder"),
env: Vec::new(),
reports: false,
quote: Quote::Posix,
};
gpui_platform::application()
.with_assets(Assets)
+51 -56
View File
@@ -7,11 +7,25 @@ use gpui::{Context, ExternalPaths};
use super::view::TerminalView;
/// What a shell reads specially in a path, which Ghostty escapes in one dropped.
const SPECIAL: &str = "\\ ()[]{}<>\"'`!#$&;|*?";
/// What a POSIX shell reads specially in a path: Ghostty's list, and zsh's `extendedglob` marks.
const SPECIAL: &str = "\\ ()[]{}<>\"'`!#$&;|*?^~";
/// The text `paths` type, each followed by a space: escaped for a Unix shell, or quoted when it holds a space, as Windows Terminal quotes it.
pub fn typed(paths: &[PathBuf], windows: bool) -> anyhow::Result<String> {
/// PowerShell's single quotes, each one doubled inside a quoted string.
const SINGLE: [char; 5] = ['\'', '\u{2018}', '\u{2019}', '\u{201a}', '\u{201b}'];
/// How a session's shell reads a path typed into it.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Quote {
/// sh, bash, zsh, fish: a backslash before each special character.
Posix,
/// Single quotes, which expand nothing.
PowerShell,
/// Double quotes, past which cmd still expands `%`.
Cmd,
}
/// The text `paths` type, each followed by a space, as `quote` keeps each one literal.
pub fn typed(paths: &[PathBuf], quote: Quote) -> anyhow::Result<String> {
paths
.iter()
.map(|path| {
@@ -21,21 +35,34 @@ pub fn typed(paths: &[PathBuf], windows: bool) -> anyhow::Result<String> {
!text.chars().any(char::is_control),
"{text:?} holds a control character, which would act as typed"
);
Ok(if windows && text.contains(' ') {
format!("\"{text}\" ")
} else if windows {
format!("{text} ")
} else {
let mut escaped = String::with_capacity(text.len() + 1);
for ch in text.chars() {
let mut out = String::with_capacity(text.len() + 3);
match quote {
Quote::Posix => text.chars().for_each(|ch| {
if SPECIAL.contains(ch) {
escaped.push('\\');
out.push('\\');
}
escaped.push(ch);
out.push(ch);
}),
Quote::PowerShell => {
out.push('\'');
text.chars().for_each(|ch| {
if SINGLE.contains(&ch) {
out.push(ch);
}
out.push(ch);
});
out.push('\'');
}
escaped.push(' ');
escaped
})
Quote::Cmd => {
anyhow::ensure!(
!text.contains(['%', '"']),
"{text:?} holds % or \", which cmd reads inside quotes"
);
out = format!("\"{text}\"");
}
}
out.push(' ');
Ok(out)
})
.collect()
}
@@ -43,10 +70,14 @@ pub fn typed(paths: &[PathBuf], windows: bool) -> anyhow::Result<String> {
impl TerminalView {
/// Types the dropped paths at the cursor as a paste; a path it cannot type stops the drop.
pub(super) fn drop_paths(&mut self, dropped: &ExternalPaths, cx: &mut Context<Self>) {
let paths = dropped.paths();
match typed(paths, cfg!(windows)) {
let (paths, quote) = (dropped.paths(), self.pty.quote);
match typed(paths, quote) {
Ok(text) => {
log::info!("terminal {}: {} paths dropped", self.pty.pid, paths.len());
log::info!(
"terminal {}: {} paths dropped, quoted for {quote:?}",
self.pty.pid,
paths.len()
);
self.paste_text(&text, cx);
}
Err(error) => log::error!(
@@ -58,40 +89,4 @@ impl TerminalView {
}
#[cfg(test)]
mod tests {
use super::*;
fn paths(all: &[&str]) -> Vec<PathBuf> {
all.iter().map(PathBuf::from).collect()
}
#[test]
fn a_unix_path_escapes_what_a_shell_reads_specially() {
let typed = |all: &[&str]| typed(&paths(all), false).unwrap();
assert_eq!(typed(&["/tmp/a.txt"]), "/tmp/a.txt ");
assert_eq!(typed(&["/tmp/my file.png"]), "/tmp/my\\ file.png ");
assert_eq!(typed(&["/a/it's (1)&$x"]), "/a/it\\'s\\ \\(1\\)\\&\\$x ");
assert_eq!(typed(&["/a/中文 b"]), "/a/中文\\ b ");
assert_eq!(
typed(&["/a", "/b c"]),
"/a /b\\ c ",
"each followed by a space"
);
}
#[test]
fn a_windows_path_is_quoted_when_it_holds_a_space() {
let typed = |all: &[&str]| typed(&paths(all), true).unwrap();
assert_eq!(typed(&["C:\\a.txt"]), "C:\\a.txt ");
assert_eq!(
typed(&["C:\\My Files\\b.txt", "D:\\c"]),
"\"C:\\My Files\\b.txt\" D:\\c "
);
}
#[test]
fn a_path_with_a_control_character_types_nothing() {
let error = typed(&paths(&["/ok", "/tmp/a\nls"]), false).unwrap_err();
assert!(error.to_string().contains("control character"), "{error}");
}
}
mod tests;
+60
View File
@@ -0,0 +1,60 @@
use super::*;
/// What `paths` type for `quote`.
fn typed_as(quote: Quote, all: &[&str]) -> String {
let paths: Vec<PathBuf> = all.iter().map(PathBuf::from).collect();
typed(&paths, quote).unwrap()
}
#[test]
fn a_posix_path_escapes_what_a_shell_reads_specially() {
let typed = |all: &[&str]| typed_as(Quote::Posix, all);
assert_eq!(typed(&["/tmp/a.txt"]), "/tmp/a.txt ");
assert_eq!(typed(&["/tmp/my file.png"]), "/tmp/my\\ file.png ");
assert_eq!(typed(&["/a/it's (1)&$x"]), "/a/it\\'s\\ \\(1\\)\\&\\$x ");
assert_eq!(
typed(&["/a/a^b~c#d"]),
"/a/a\\^b\\~c\\#d ",
"zsh's extendedglob"
);
assert_eq!(typed(&["/a/中文 b"]), "/a/中文\\ b ");
assert_eq!(
typed(&["/a", "/b c"]),
"/a /b\\ c ",
"each followed by a space"
);
}
#[test]
fn a_powershell_path_is_single_quoted_with_its_quotes_doubled() {
let typed = |all: &[&str]| typed_as(Quote::PowerShell, all);
assert_eq!(typed(&["C:\\a.txt"]), "'C:\\a.txt' ");
assert_eq!(typed(&["C:\\tmp\\it's.txt"]), "'C:\\tmp\\it''s.txt' ");
assert_eq!(typed(&["C:\\$HOME $(1+1);x"]), "'C:\\$HOME $(1+1);x' ");
assert_eq!(
typed(&["C:\\a\u{2019}b"]),
"'C:\\a\u{2019}\u{2019}b' ",
"a curly quote"
);
assert_eq!(typed(&["/a b", "/c"]), "'/a b' '/c' ");
}
#[test]
fn a_cmd_path_is_double_quoted_and_one_with_a_percent_types_nothing() {
let typed = |all: &[&str]| typed_as(Quote::Cmd, all);
assert_eq!(
typed(&["C:\\My Files\\a&b^c.txt", "D:\\c"]),
"\"C:\\My Files\\a&b^c.txt\" \"D:\\c\" "
);
let percent = super::typed(&[PathBuf::from("C:\\%PATH%.txt")], Quote::Cmd);
assert!(percent.is_err(), "{percent:?}");
}
#[test]
fn a_path_with_a_control_character_types_nothing() {
for quote in [Quote::Posix, Quote::PowerShell, Quote::Cmd] {
let paths = [PathBuf::from("/ok"), PathBuf::from("/tmp/a\nls")];
let error = typed(&paths, quote).unwrap_err();
assert!(error.to_string().contains("control character"), "{error}");
}
}
+1
View File
@@ -31,6 +31,7 @@ mod view;
mod win32;
pub mod zoom;
pub use drop::Quote;
pub use fonts::{ICONS, MONO, load_font};
pub use pty::{Events, Launch, Listener, Pty, PtyEvent, config, fit, spawn};
pub use status::{Kind, Record, Records, State};
+5 -1
View File
@@ -11,7 +11,7 @@ use alacritty_terminal::{
};
use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded};
use super::{marks::Mark, mouse::MouseMode, notify::Ask, status::Status, tap::Tapped};
use super::{drop::Quote, marks::Mark, mouse::MouseMode, notify::Ask, status::Status, tap::Tapped};
use crate::settings::{CursorStyle, Settings};
/// What a session hears from its pty.
@@ -61,12 +61,15 @@ pub struct Launch {
pub env: Vec<(String, String)>,
/// Shell integration makes it report its folder.
pub reports: bool,
/// How its shell reads a path dropped on it.
pub quote: Quote,
}
/// A running program on a pseudo-terminal and the grid it draws into.
pub struct Pty {
pub term: Arc<FairMutex<Term<Listener>>>,
pub pid: u32,
pub quote: Quote,
notifier: Notifier,
#[cfg(unix)]
master: std::fs::File,
@@ -152,6 +155,7 @@ pub fn spawn(
Pty {
term,
pid,
quote: launch.quote,
notifier,
#[cfg(unix)]
master,
+6 -1
View File
@@ -5,7 +5,7 @@ use alacritty_terminal::{
use futures::StreamExt;
use super::*;
use crate::term::marks::Click;
use crate::term::{drop::Quote, marks::Click};
use crate::term::{
notify::Ask,
status::{Record, State},
@@ -35,6 +35,7 @@ fn run(script: &str, size: (usize, usize)) -> Ran {
cwd: std::env::temp_dir(),
env: vec![("ELY".into(), "ok".into())],
reports: false,
quote: Quote::Posix,
};
let (pty, mut events) =
spawn(&launch, size, (8, 16), config(&Settings::default())).expect("sh starts");
@@ -241,6 +242,7 @@ fn the_foreground_is_the_program_s_own_group() {
cwd: std::env::temp_dir(),
env: Vec::new(),
reports: false,
quote: Quote::Posix,
};
let (pty, _events) =
spawn(&launch, (20, 4), (8, 16), config(&Settings::default())).expect("sh starts");
@@ -270,6 +272,7 @@ fn close_after_ready(script: &str, reaped: &str) {
cwd: std::env::temp_dir(),
env: Vec::new(),
reports: false,
quote: Quote::Posix,
};
let (pty, mut events) =
spawn(&launch, (20, 4), (8, 16), config(&Settings::default())).expect("sh starts");
@@ -316,6 +319,7 @@ fn a_missing_folder_stops_the_start() {
cwd: "/nonexistent/ely".into(),
env: Vec::new(),
reports: false,
quote: Quote::Posix,
};
let error = spawn(&launch, (20, 4), (8, 16), config(&Settings::default()))
.err()
@@ -334,6 +338,7 @@ fn a_folder_that_cannot_be_entered_stops_the_start() {
cwd: folder.clone(),
env: Vec::new(),
reports: false,
quote: Quote::Posix,
};
let started = spawn(&launch, (20, 4), (8, 16), config(&Settings::default()));
std::fs::set_permissions(&folder, std::fs::Permissions::from_mode(0o700)).expect("700");
+6 -1
View File
@@ -7,7 +7,7 @@ use std::{
use anyhow::Context as _;
use gpui::{App, Global};
use super::pty::Launch;
use super::{drop::Quote, pty::Launch};
/// Each script, by its path under the integration folder.
const SCRIPTS: [(&str, &str); 4] = [
@@ -89,6 +89,11 @@ pub fn launch(shell: &str, cwd: PathBuf, dir: &Path) -> anyhow::Result<Launch> {
cwd,
env: Vec::new(),
reports: true,
quote: match name.as_str() {
"pwsh" | "powershell" => Quote::PowerShell,
"cmd" => Quote::Cmd,
_ => Quote::Posix,
},
};
let script = |name: &str| dir.join(name).display().to_string();
match name.as_str() {
+21
View File
@@ -437,3 +437,24 @@ fn an_unknown_shell_starts_without_integration() {
assert_eq!(launch.program, Some(("/bin/sh".into(), Vec::new())));
assert!(launch.env.is_empty());
}
#[test]
fn each_shell_reads_a_dropped_path_its_own_way() {
use std::os::unix::fs::PermissionsExt;
let dir = folder("quote");
for (name, quote) in [
("zsh", Quote::Posix),
("fish", Quote::Posix),
("pwsh", Quote::PowerShell),
("powershell", Quote::PowerShell),
("cmd", Quote::Cmd),
("other", Quote::Posix),
] {
let program = dir.join(name);
fs::write(&program, "").expect("a program");
fs::set_permissions(&program, fs::Permissions::from_mode(0o755)).expect("its mode");
let shell = program.to_str().expect("utf-8");
let launch = launch(shell, PathBuf::from("/"), &dir).expect("a launch");
assert_eq!(launch.quote, quote, "{name}");
}
}
+1 -1
View File
@@ -71,7 +71,7 @@ What no check reached: no real KWin drew the blur; of Wayland desktops, only Hyp
| OSC 8 and plain links on Cmd-press, Ctrl-press off macOS; inside herdr, herdr opens them whole | T09, T45 | `term::links` tests; on macOS with real herdr 0.9.5 and a stand-in `open` on its PATH, Cmd-press on a URL herdr wraps, on its wrapped tail, on an OSC 8 link and on a URL over three rows opened the whole URL and the OSC 8 target, where before the app opened `.../ELYTermin` and nothing; Cmd-hover underlined the long URL across its rows; outside herdr the app opened the URL itself; an OSC 8 link whose label holds `file:///etc/hosts` and whose target is a web page opened the page through herdr, which keeps the target from the terminal while it takes the mouse; Shift-Cmd-press on a plain `file:///etc/hosts` inside herdr the app opened itself, caught by an `NSWorkspace` stand-in | Pass |
| Focus reporting, title, scrollback limit, find | T10 | `term::find` tests; round 3 failed at the cap, its fix stands on a red-green test | Pass |
| A scrollbar over the history: a drag on its thumb scrolls, whatever the program does with the wheel | T58 | `term::scrollbar` test: the thumb's share and place follow the history and the view's offset, and a place past either end of the track holds at it; under Xorg's dummy screen, after `seq 1 500`, the thumb stood at the bottom right, a drag to the top showed the first prompt and lines 1 to 39, and one back down lines 220 to 259; with mouse tracking on, the wheel went to the program as reports and did not scroll, while a drag on the thumb showed lines 245 to 284 | Pass |
| Drop: files dropped on the terminal type their paths at the cursor, escaped for the shell, quoted on Windows, each followed by a space | T66 | `term::drop` tests: a Unix path escapes what a shell reads specially, spaces, quotes, parentheses, `&` and `$` among them, CJK kept, each path followed by a space; a Windows path is quoted when it holds a space; a path with a control character types nothing; on macOS `shot` dropped `/tmp/my file.png`, `/Users/x/it's (1).txt` and `/a/中文 b` on zsh after a pointer move, and the log read `3 paths dropped` and `pastes 53 characters, bracketed`; without the move, after typing, gpui passed the drop by, as AGENTS records | Pass |
| Drop: files dropped on the terminal type their paths at the cursor, kept literal for the session's shell, each followed by a space | T66 | `term::drop` tests: a POSIX path escapes what a shell reads specially, spaces, quotes, parentheses, `&`, `$`, `^`, `~` and `#` among them, CJK kept, each path followed by a space; a PowerShell path is single-quoted with its quotes doubled, curly ones too; a cmd path is double-quoted, and one holding `%` types nothing; a path with a control character types nothing; `term::shell` test: zsh, fish and other shells take POSIX quoting, pwsh and powershell PowerShell's, cmd cmd's; round 1 of T66's review found Windows' quotes around a spaced path alone leaving `$(...)` and `;` live in PowerShell, and `^` unescaped under zsh's `extendedglob`: the formatter, extracted, typed 22 hard names that zsh with and without `extendedglob`, bash with `extglob`, fish and PowerShell each read back exactly, `it's`, `$HOME`, `$(1+1)`, `a;Write-Output(42)` and curly quotes among them, and cmd on the owner's PC echoed `&`, `|`, `<`, `>` and `^` inside its quotes back as text while it expanded `%PATH%`; on macOS `shot` dropped `/tmp/my file.png`, `/Users/x/it's (1).txt` and `/a/中文 b` on zsh after a pointer move, and the log read `3 paths dropped` and `pastes 53 characters, bracketed`; without the move, after typing, gpui passed the drop by, as AGENTS records | Pass |
| Click to move: a plain click on the line the shell reads, past its prompt, moves its cursor there, the press itself to a shell that takes clicks, else arrows | T59 | `term::marks` test: A's `click_events=1` and `2` read as a press at the screen's row or counted from the prompt; `term::click` tests: a shell that takes clicks hears an SGR left press at the clicked cell, a row below the prompt too, none before the prompt, in the history or on the alternate screen; B reads the line its prompt started; a click on the typed line counts the characters to it, left or right, past the end means the end, a wide character takes one arrow, soft-wrapped rows are one line, trailing spaces count up to the cursor, and a click on the prompt, another line, a line no prompt shows, output without marks or the alternate screen moves nothing; on macOS `shot` ran zsh with a marked prompt: after `echo hello` a click on the `h` logged `moves the cursor -5`, and `X` typed then ran `echo Xhello`; a drag sent nothing, and clicks on the prompt and on output logged `off the input`; round 1 of T59's review found fish 4.9 a code point per Left, so a count put `X` inside `é`, and its redraw dropped the wrap flag a count followed: with fish's own `click_events=1` the press goes to fish, which then typed `echo Xéabc`, and a second click on the redrawn wrapped line put `Y` at row 2, column 3; zsh still counted 4 arrows; a press let go in another cell and one whose program turned on tracking before the release sent nothing; round 2 found a click on fish's `$` sent to fish, which moved its cursor to the start: a press now goes only past the prompt's last cell before the cursor and never on a prompt cell, so clicks on `$` and its space logged `off the input` and `X` still ended `echo helloX`; round 3 found that a prompt whose only cells lie after the cursor, fish's empty left prompt beside a marked right one, crashed the press: with no prompt cell before the cursor the input starts at the prompt's first row, and a click on `o` there put `X` at `echXo`; round 3 found that a prompt that prints nothing left no cells to find the input by, so clicks on fish's typed line did nothing: B now stamps the typed line with a link of its own, numbered by the commands ended, so fish's empty prompt gave `abcXdef`, with a plain or no right prompt too, a click on the output above moved nothing, and fish's right prompt drawn again at each key kept the typed line's number, `echXo`; `term::prompts` test: input carries the commands ended before it, through a prompt drawn again; `term::click` tests: a prompt that prints nothing starts the input at its first typed cell, the output and the line run before refused; round 4 found the newest typed line taken by its place: after `printf '\e[H'` fish drew its prompt at the top over older lines, and a click on its typed line did nothing; the newest line is now the one of the highest number, and a press goes no lower than its last row or the cursor's, so that click gave `abcXdef`, the reviewer's scene sent `ESC[<0;6;1M`, and a click on the older text below moved nothing, where fish had moved its cursor | Pass |
| A bell makes no sound; the row marks it | T10, T12 | T12 review | Pass |