From 0a222007258350170d84787e8e5b76c91b97d0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Fri, 16 Oct 2026 22:45:25 -0400 Subject: [PATCH] T34: review round 1: PowerShell reads a native program's code only when one ran in the command, by the new object each run stores, and 1 for any other failure; bash 3.2 runs the user's own DEBUG trap after its own and keeps $_, and a line that is only a subshell sends its D from the prompt by the command number; zsh marks the first prompt under a theme that sets PS1 in its own hook, through sched; each shell run gets its own folder --- AGENTS.md | 2 +- .../shell-integration/bash/elyterminal.bash | 32 ++++++-- assets/shell-integration/pwsh/elyterminal.ps1 | 13 ++-- assets/shell-integration/zsh/.zshenv | 9 ++- src/term/shell/tests.rs | 73 ++++++++++++++++--- tasks/acceptance.md | 2 +- 6 files changed, 103 insertions(+), 28 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index de72a17..e508589 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,4 +96,4 @@ ELYTerminal. A terminal on GPUI and Ely components. `PRD.md` says what it does; - 2026-10-16: herdr 0.9 keeps its panes' OSC 7 and writes only a title, notifications, OSC 52 and bells to the terminal it runs in, so no terminal hears a folder from inside it; herdr's server knows each pane's `cwd`, the folder its shell reported, else the shell's own. On macOS and Linux each session asks twice a second which process group leads its pty's foreground (`tcgetpgrp` on a copy of the master) and what executable that group's leader runs: an exec keeps the group and swaps the executable, so `exec herdr` from a shell is a new program, and one that did not read is tried again; on Linux the ` (deleted)` mark an update leaves on a running executable is set aside. When that executable is `herdr` and its arguments start herdr's terminal client (no command, `session attach NAME` or `client`), ELYTerminal reads the client's arguments and variables (`/proc` on Linux; `KERN_PROCARGS2` on macOS, which hides only the variables of Apple's own programs) and finds its socket as herdr 0.9 does: `--session NAME`, then `HERDR_SOCKET_PATH`, then `HERDR_SESSION`, under `$XDG_CONFIG_HOME/herdr`, else `~/.config/herdr`; a relative socket lies in the client's folder, as herdr reads it (`/proc/PID/cwd`; `proc_pidinfo` on macOS). It asks that socket for `session.snapshot` twice a second, a connection each, since herdr closes one after its reply, and reports the focused pane's `cwd` as the session's folder when it changes and again each time herdr takes the foreground; an answer that lands after the shell reported a folder is dropped, since the shell reports only once herdr has left. Focus belongs to herdr's server, so clients of one server follow one focus; a client of another machine's server (`--remote`, `--machine`) is logged, not followed. A failure is logged once while it lasts. On Windows, which has no foreground group, a Toolhelp32 snapshot lists the `herdr.exe` processes at or under the session's shell, none under another herdr, since what a herdr starts, its server too, is its own; when that list changes, `sysinfo` reads their arguments and variables, nearest first, names in upper case, as Windows matches them, and the first terminal client is followed, a server or a command beside it passed by; its folder is found as herdr 0.9 finds it there, `XDG_CONFIG_HOME`, then `APPDATA`, then `USERPROFILE\AppData\Roaming`, then `HOME\.config`; and its server answers on the pipe herdr names `\\.\pipe\` and the socket's path as written, relative or not. A busy pipe is waited for, as herdr's client waits, and the pipe's server may identify ELYTerminal but never act as it. The pipe has no timeout: a herdr that never answers holds that session's follow until it answers or exits. - 2026-10-16: the main window opens at the size it was left at, which the owner asked for on macOS, Windows and Linux: `window_width` and `window_height` in the settings hold the size gpui's `window_bounds` gives 0.5 s after the bounds settle, saved through `SettingsStore::update`, which writes only a change, so a drag saves once and a move saves nothing. A maximized, full-screen or hidden window keeps the size from before; its state and size are read once they settle, since X11 marks a window maximized after its new size, gpui's X11 window then gives a maximized window's own size, and it calls a maximized window unmaximized while minimized. A window that shows again, uncovered, restored or back on its screen, is read again, so a size it took just before it hid is kept; a size it takes in the half second before it closes, or before it hides until the app quits, is lost. The window is no smaller than 100 by 100, the least the settings keep, or a smaller size the platform allows could not be kept. The window opens centered at whole points, since macOS grows a window by a point on a side whose edge falls on a half point; its place is not kept, and a kept side past the primary display's visible area shrinks to it, logged. A size outside 100 to 16384 stops the start, as any value out of range does. - 2026-10-16: the sessions and right columns resize by a drag on their border toward the terminal, which the owner asked for on macOS, Windows and Linux. Ely's `ShellColumn::resizable`, added to Ely for this, puts Ely's `resize_handle` on the border toward the filling column, the sessions column's right and the right column's left: the handle draws that border, a filled hairline, since gpui paints a border no wider than half its box, and the line it drew at first showed half a pixel on macOS and none on X11; it occludes the header under it, so a press there drags the border, not the window, on Windows too, where an unoccluded drag region takes the press as the caption. A drag sets off from the wider of the width drawn and the one kept: a header's parts may hold a column wider, and a window too narrow for both widths squeezes them, where a drag from the squeezed width jumped back against the pointer; a drag that has not moved sideways changes nothing, and one that comes back where it set off gives the width it had. A set width in Ely became a flex basis, so a column holds its header's own parts: at a set width under them, Windows' caption buttons ran out of the window. The widths, 160 to 960 pixels, show at once and are saved in `sessions_width` and `panel_width` through `SettingsStore::update` 0.5 s after a drag rests, as the window's size is; a drag in the half second before the window closes is lost, and a save the store refuses puts the columns back. A window too narrow for both yields the terminal its header's width, as Ely's set widths give way. -- 2026-10-16: prompts and commands carry OSC 133 marks, which the owner asked for, read as Ghostty reads them: A or N starts a prompt, B or I ends it, C starts a command's output, and D ends the command with its status, D's first option, none when that is no number. The tap reads any program's marks before the parser, so it never sees the cursor: A's fresh line and L, which need it, are not done, and P adds nothing to A. Each session keeps the status its last command ended with. The integration marks what the shell leaves unmarked, and the user's prompt still sees the command's status. zsh: precmd reads `$?` and sends D after a command ran, preexec sends C, and a last precmd hook wraps PS1 in A and B under `prompt_percent`; it moves to the end of `precmd_functions` at each prompt, since a theme that sets PS1 in a hook of its own loads after it, so such a theme's first prompt goes unmarked. bash: PROMPT_COMMAND's first entry reads `$?`, which each entry resets, and its last wraps PS1; from bash 4.4 C rides PS0, whose subscript notes that a command ran, since bash prints no PS0 for an empty line; macOS's bash 3.2 has no PS0, so a DEBUG trap armed at the prompt sends C, unless the user set one. fish 4.3 marks its own prompts and commands, fish 4.0 all but B, older ones none: the script adds what the running fish lacks, around the prompt shown, and wraps it again when the user's changes. PowerShell: the prompt reads `$?` first and sets it back for the user's prompt through `Write-Error '' -ErrorAction Ignore`, which adds nothing to `$Error`; a command that left a new error ended with 1, any other failure with `$LASTEXITCODE`, read through `Get-Variable`, since strict mode refuses an unset variable and a prompt that fails falls back to `PS>`; C goes out when PSReadLine hands over a line that is not blank. herdr passes no OSC 133 on, so a session running herdr keeps the status from before it. +- 2026-10-16: prompts and commands carry OSC 133 marks, which the owner asked for, read as Ghostty reads them: A or N starts a prompt, B or I ends it, C starts a command's output, and D ends the command with its status, D's first option, none when that is no number. The tap reads any program's marks before the parser, so it never sees the cursor: A's fresh line and L, which need it, are not done, and P adds nothing to A. Each session keeps the status its last command ended with. The integration marks what the shell leaves unmarked, and the user's prompt still sees the command's status. zsh: precmd reads `$?` and sends D after a command ran, preexec sends C, and a last precmd hook wraps PS1 in A and B under `prompt_percent`; it moves to the end of `precmd_functions` at each prompt, since a theme that sets PS1 in a hook of its own loads after it, and at the first prompt `sched +0` wraps it once more, since zsh runs due events after every precmd hook; that call returns the command's status, which the prompt shows, but it would reset `$pipestatus`, so it serves the first prompt alone. bash: PROMPT_COMMAND's first entry reads `$?`, which each entry resets, and sends D once a command ran, and its last wraps PS1. From bash 4.4 PS0 sends C and its subscript notes that a command ran, since bash prints no PS0 for an empty line; both need `promptvars`, on by default. macOS's bash 3.2 has no PS0: a DEBUG trap armed at the prompt sends C and notes it, then runs any trap the user set, with `$?` kept, and `$_` too, since the call is passed `$_` and bash sets `$_` from a call's last word. bash 3.2 runs no trap for a line that is only a subshell, so such a line sends no C, and its D comes from PS1 once `\#`, the command number, has moved; readline sends a prompt's escapes again at each redraw, so D rides PS1 only then. fish 4.3 marks its own prompts and commands, fish 4.0 all but B, older ones none: the script adds what the running fish lacks, around the prompt shown, and wraps it again when the user's changes. PowerShell: the prompt reads `$?` first and sets it back for the user's prompt through `Write-Error '' -ErrorAction Ignore`, which adds nothing to `$Error`; a failure ends with `$LASTEXITCODE` when a native program set it during the command, since each run stores a new object, equal or not, which `[object]::ReferenceEquals` tells apart, and with 1 otherwise, a cmdlet's under `-ErrorAction Ignore` too; it is read through `Get-Variable`, since strict mode refuses an unset variable and a prompt that fails falls back to `PS>`. C goes out when PSReadLine hands over a line that is not blank. herdr passes no OSC 133 on, so a session running herdr keeps the status from before it. diff --git a/assets/shell-integration/bash/elyterminal.bash b/assets/shell-integration/bash/elyterminal.bash index 5daf653..e42d9eb 100644 --- a/assets/shell-integration/bash/elyterminal.bash +++ b/assets/shell-integration/bash/elyterminal.bash @@ -13,28 +13,37 @@ else [ -r ~/.bashrc ] && builtin source ~/.bashrc fi _ely_ran= +_ely_sent= +_ely_n=0 _ely_armed= _ely_ps0= if (( BASH_VERSINFO[0] * 100 + BASH_VERSINFO[1] >= 404 )); then # PS0 runs in the shell, so its subscript can note that a command ran. _ely_ps0='${_ely_note[_ely_ran=1]-}\e]133;C\a' -elif [ -z "$(builtin trap -p DEBUG)" ]; then +else + # bash 3.2 has no PS0: the DEBUG trap sends C, then runs the user's own trap with $? and $_ kept. _ely_debug() { - [ -n "$_ely_armed" ] || builtin return 0 - case $BASH_COMMAND in _ely_*) builtin return 0 ;; esac - _ely_armed= - _ely_ran=1 - builtin printf '\e]133;C\a' + builtin local status=$? + if [ -n "$_ely_armed" ] && [[ $BASH_COMMAND != _ely_* ]]; then + _ely_armed= + _ely_ran=1 + builtin printf '\e]133;C\a' + fi + builtin return $status } - builtin trap '_ely_debug' DEBUG + builtin eval "_ely_trap=($(builtin trap -p DEBUG))" + builtin trap "_ely_debug \"\$_\"${_ely_trap[2]:+; ${_ely_trap[2]}}" DEBUG + builtin unset _ely_trap fi _ely_prompt() { builtin local ret=$? LC_ALL=C char url= i title _ely_armed= + _ely_sent=$_ely_ran if [ -n "$_ely_ran" ]; then builtin printf '\e]133;D;%s\a' "$ret" _ely_ran= fi + _ely_d=([1]=$'\e]133;D;'"$ret"$'\a') for (( i = 0; i < ${#PWD}; i++ )); do char=${PWD:i:1} case $char in @@ -48,7 +57,14 @@ _ely_prompt() { } # Last, after anything that sets PS1 or PS0. _ely_mark() { - [[ $PS1 == *'\e]133;A'* ]] || PS1='\[\e]133;A\a\]'"$PS1"'\[\e]133;B\a\]' + if [[ $PS1 != *'\e]133;A'* ]]; then + if builtin shopt -q promptvars; then + # bash 3.2 traps no line that is only a subshell; \# counts it, so the prompt sends its D. + PS1='\[${_ely_d[!_ely_sent && _ely_n && \# != _ely_n]-}${_ely_note[_ely_n = \#]-}\e]133;A\a\]'"$PS1"'\[\e]133;B\a\]' + else + PS1='\[\e]133;A\a\]'"$PS1"'\[\e]133;B\a\]' + fi + fi if [ -n "$_ely_ps0" ] && builtin shopt -q promptvars && [[ ${PS0-} != *"$_ely_ps0"* ]]; then PS0=$_ely_ps0${PS0-} fi diff --git a/assets/shell-integration/pwsh/elyterminal.ps1 b/assets/shell-integration/pwsh/elyterminal.ps1 index 226c81f..abab11b 100644 --- a/assets/shell-integration/pwsh/elyterminal.ps1 +++ b/assets/shell-integration/pwsh/elyterminal.ps1 @@ -6,11 +6,12 @@ function global:prompt { $ok = $? $esc, $bel = [char]27, [char]7 if ($global:ElyRan) { - $code = 1 - if ($ok) { $code = 0 } - elseif ($Error.Count -eq 0 -or [object]::ReferenceEquals($Error[0], $global:ElyError)) { - # No new error: a native program failed. Strict mode refuses an unset variable. - $code = Get-Variable LASTEXITCODE -Scope Global -ValueOnly -ErrorAction Ignore + $code = 0 + if (-not $ok) { + # Each native run sets a new $LASTEXITCODE, equal or not; strict mode refuses an unset one. + $exit = Get-Variable LASTEXITCODE -Scope Global -ValueOnly -ErrorAction Ignore + $ran = $null -ne $exit -and -not [object]::ReferenceEquals($exit, $global:ElyExit) + $code = if ($ran -and $exit -ne 0) { $exit } else { 1 } } [Console]::Write("$esc]133;D;$code$bel") $global:ElyRan = $false @@ -36,7 +37,7 @@ if (Test-Path Function:\PSConsoleHostReadLine) { $line = & $global:ElyReadLine if (-not [string]::IsNullOrWhiteSpace($line)) { $global:ElyRan = $true - $global:ElyError = if ($Error.Count) { $Error[0] } + $global:ElyExit = Get-Variable LASTEXITCODE -Scope Global -ValueOnly -ErrorAction Ignore [Console]::Write("$([char]27)]133;C$([char]7)") } $line diff --git a/assets/shell-integration/zsh/.zshenv b/assets/shell-integration/zsh/.zshenv index 80f0afe..80e77ee 100644 --- a/assets/shell-integration/zsh/.zshenv +++ b/assets/shell-integration/zsh/.zshenv @@ -8,6 +8,7 @@ fi [[ -r "${ZDOTDIR:-$HOME}/.zshenv" ]] && builtin source "${ZDOTDIR:-$HOME}/.zshenv" if [[ -o interactive ]]; then _ely_ran= + _ely_first=1 _ely_precmd() { builtin local ret=$? LC_ALL=C char url= if [[ -n $_ely_ran ]]; then @@ -21,14 +22,20 @@ if [[ -o interactive ]]; then url+=$char done builtin printf '\e]7;file://%s\a\e]2;%s\a' "$url" "${${${PWD:t}:-/}//[[:cntrl:]]/}" - # Themes set PS1 in later hooks; from the next prompt the marks go on after them. + # Themes set PS1 in later hooks: the marks go on after them, at the first prompt through sched. precmd_functions=(${precmd_functions:#_ely_mark} _ely_mark) + if (( _ely_first )); then + _ely_first=0 + builtin zmodload zsh/sched && builtin sched +0 _ely_mark $ret + fi builtin return ret } _ely_mark() { if [[ -o prompt_percent && $PS1 != *$'\e]133;A'* ]]; then PS1=$'%{\e]133;A\a%}'$PS1$'%{\e]133;B\a%}' fi + # sched's command leaves its status for the prompt. + builtin return ${1:-0} } _ely_preexec() { _ely_ran=1 diff --git a/src/term/shell/tests.rs b/src/term/shell/tests.rs index 2ccf23a..7e96252 100644 --- a/src/term/shell/tests.rs +++ b/src/term/shell/tests.rs @@ -1,4 +1,7 @@ -use std::time::{Duration, Instant}; +use std::{ + sync::atomic::{AtomicUsize, Ordering}, + time::{Duration, Instant}, +}; use alacritty_terminal::{event::Event, grid::Dimensions, index::Line}; use futures::channel::mpsc::TryRecvError; @@ -51,9 +54,12 @@ impl Run { /// Starts `shell` in a fresh folder; `files` go under its HOME first. fn start(shell: &str, files: &[(&str, &str)]) -> Self { crate::testlog::init(); + // Two tests may run one shell at once. + static RUNS: AtomicUsize = AtomicUsize::new(0); let root = folder(&format!( - "shell-{}", - shell.rsplit('/').next().expect("a name") + "shell-{}-{}", + shell.rsplit('/').next().expect("a name"), + RUNS.fetch_add(1, Ordering::Relaxed) )); let (dir, home, start) = ( root.join("integration"), @@ -136,6 +142,10 @@ impl Run { /// The prompt's folder, the script loaded by `probe`, then a cd into the inner folder. fn walk(&mut self, probe: &str) { + let first = [Mark::Prompt, Mark::Input]; + self.until("the first prompt's marks", |run| { + run.marks.starts_with(&first) + }); let start = self.start.clone(); self.send(probe); self.until("first folder", |run| run.folders.contains(&start)); @@ -146,11 +156,12 @@ impl Run { self.until("inner folder", |run| run.folders.contains(&inner)); } - /// Types `line`, the last command sent, which fails with 1; its marks follow its earlier ones. - fn fails(&mut self, line: &str) { + /// Types `line`, the last command sent, and waits for the marks it ends with. + fn ends(&mut self, line: &str, marks: &[Mark]) { self.send(line); - let after = [Mark::Output, Mark::Done(Some(1)), Mark::Prompt, Mark::Input]; - self.until("marks of the failure", |run| run.marks.ends_with(&after)); + self.until(&format!("the marks of {line}"), |run| { + run.marks.ends_with(marks) + }); } fn finish(mut self) { @@ -174,6 +185,16 @@ impl Run { } } +/// The marks a command that ends with `status` leaves: its output, its end, the next prompt. +fn ended(status: i32) -> [Mark; 4] { + [ + Mark::Output, + Mark::Done(Some(status)), + Mark::Prompt, + Mark::Input, + ] +} + #[test] fn the_scripts_install_once_and_mend_a_changed_one() { let dir = folder("install"); @@ -217,10 +238,13 @@ fn zsh_reports_its_folder_byte_for_byte_and_its_titles() { "{:?}", run.titles ); - run.fails("false"); + run.ends("false", &ended(1)); run.until("the theme's prompt", |run| { run.shows("THEME 0 > false") && run.shows("THEME 1 >") }); + run.send("false | true"); + run.send("echo PIPE=$pipestatus"); + run.until("the pipeline's statuses", |run| run.shows("PIPE=1 0")); run.finish(); } @@ -233,9 +257,28 @@ fn bash_reports_its_folder_byte_for_byte_and_keeps_the_status() { run.until("title", |run| { run.titles.iter().any(|title| title == "in ner%xy") }); - run.fails("false"); + run.ends("false", &ended(1)); run.until("kept status", |run| run.shows("USER_STATUS=1")); assert!(run.shows("$ false"), "{}", run.screen()); + // bash 3.2 traps no part of a lone subshell, so its C may not come. + run.ends( + "(exit 7)", + &[Mark::Done(Some(7)), Mark::Prompt, Mark::Input], + ); + run.send(r#"ls / >/dev/null; echo "LAST=$_""#); + run.until("the last argument", |run| run.shows("LAST=/\n")); + run.finish(); +} + +#[test] +fn bash_runs_the_user_s_debug_trap_beside_its_own() { + let trap = r#"_user_trap() { USER_TRAP=yes; }; trap '_user_trap "$_"' DEBUG"#; + let files = [(".bashrc", trap), (".bash_profile", trap)]; + let mut run = Run::start(&installed("bash"), &files); + run.walk("declare -F _ely_prompt >/dev/null && echo ELY-LOAD''ED"); + run.ends("false", &ended(1)); + run.send(r#"echo "TRAP=$USER_TRAP""#); + run.until("the user's trap", |run| run.shows("TRAP=yes")); run.finish(); } @@ -249,7 +292,7 @@ fn fish_loads_its_script_and_restores_its_data_dirs() { run.until("restored dirs", |run| run.shows(&restored)); // The prompt hears each command's own status, none failed so far. assert!(!run.shows("[1]"), "{}", run.screen()); - run.fails("false"); + run.ends("false", &ended(1)); run.until("the failed status", |run| run.shows("[1]>")); run.finish(); } @@ -267,9 +310,17 @@ fn powershell_reports_its_folder_byte_for_byte_and_keeps_the_status() { run.until("title", |run| { run.titles.iter().any(|title| title == "in ner%xy") }); - run.fails("/usr/bin/false"); + run.ends("/usr/bin/false", &ended(1)); run.until("kept status", |run| run.shows("USER_SUCCESS=False")); assert!(run.shows("> /usr/bin/false"), "{}", run.screen()); + // A cmdlet's failure leaves no error behind, and a native code may repeat. + run.ends("/usr/bin/true", &ended(0)); + run.ends("Get-Item ./missing -ErrorAction Ignore", &ended(1)); + run.ends("sh -c 'exit 3'", &ended(3)); + run.ends("sh -c 'exit 3'", &ended(3)); + run.ends("Get-Item ./missing", &ended(1)); + let native = "$PSNativeCommandUseErrorActionPreference = $true; sh -c 'exit 7'"; + run.ends(native, &ended(7)); run.finish(); } diff --git a/tasks/acceptance.md b/tasks/acceptance.md index ae19942..21e14ab 100644 --- a/tasks/acceptance.md +++ b/tasks/acceptance.md @@ -51,7 +51,7 @@ What no check reached: no real KWin drew the blur; of Wayland desktops, only Hyp |---|---|---|---| | PTY through alacritty's event loop; OSC 7 and OSC 133 scanned on the reader | T04, T34 | `term::pty`, `term::tap` tests; round 3 failed at the cap, its fix stands on a red-green test | Pass | | Shell integration for zsh, bash, fish, PowerShell; a shell without it reports nothing and the panels say so | T05 | `term::shell` tests on macOS and Linux | Pass | -| Prompt marks, OSC 133, from the shell integration and any program; each session keeps its last command's status | T34 | `term::marks` tests: each letter and option as Ghostty reads them; `term::tap` and `term::pty` tests: marks split across reads reach the session in order; `term::shell` tests: zsh, bash, fish and PowerShell send C, D;1, A and B around a failing command, and the user's prompt still shows the failure, a zsh theme's that sets PS1 in its own hook too; on macOS fish 4.9 marks itself and bash 3.2 marks C through its DEBUG trap, in the Linux container fish 4.0 gets B and bash 5.2 marks C through PS0, CI's Ubuntu runs fish 3.7, which the script marks whole; by hand in a pty, PowerShell under strict mode, and a cmdlet's failure after a native one's reads 1 | Pass | +| Prompt marks, OSC 133, from the shell integration and any program; each session keeps its last command's status | T34 | `term::marks` tests: each letter and option as Ghostty reads them; `term::tap` and `term::pty` tests: marks split across reads reach the session in order; `term::shell` tests: zsh, bash, fish and PowerShell send C, D;1, A and B around a failing command, and the user's prompt still shows the failure, a zsh theme's that sets PS1 in its own hook too, whose first prompt is marked before any command, and `$pipestatus` stays; bash's lone subshell ends with D;7, `$_` stays, and the user's DEBUG trap runs beside the script's; PowerShell reads 1 for a cmdlet's failure under `-ErrorAction Ignore` after a success, a native code twice, and a native failure's code under `$PSNativeCommandUseErrorActionPreference`; on macOS fish 4.9 marks itself and bash 3.2 marks C through its DEBUG trap, in the Linux container fish 4.0 gets B and bash 5.2 marks C through PS0, CI's Ubuntu runs fish 3.7, which the script marks whole; by hand in a pty, PowerShell under strict mode, and a cmdlet's failure after a native one's reads 1 | Pass | | Inside herdr, the folder of herdr's focused pane, read from its socket, on macOS, Linux and Windows | T29, T32 | `term::herdr` tests: the socket found as herdr 0.9 finds it, only the terminal client followed and a remote one refused, the snapshot read, a socket round trip, a process's path, arguments and variables; `the_foreground_is_the_program_s_own_group`; on X11 with herdr 0.9.5 run in the session: its start showed the focused pane's folder, a cd in the pane moved the panel, the focus moved to a pane in `/etc` and back moved it each time, and the client's end gave the panel back to bash's report, then `exec herdr` from that bash, with `HERDR_SOCKET_PATH` relative to its folder, was followed through the socket there; on macOS under `shot`, herdr 0.9.5 as the program and again by `exec` from `sh` with a relative socket, its pane's cd moved the panel; on Windows, `term::herdr` tests on the CI runner: the folder under `APPDATA` and `USERPROFILE`, the `herdr.exe` nearest under the shell, this test's name, arguments and variables read through the live process list and `sysinfo`, a round trip over a named pipe; no real herdr has run on Windows yet | Partial | | Colors, styles, five underlines, wide characters, combining marks | T06 | `term::frame`, `term::ink`, `term::paint` tests | Pass | | Box drawing, blocks and powerline shapes as geometry | T07 | `term::boxes` tests | Pass |