T16: a shell saves only when the running user may run it, as access answers, ACLs too, found at a full path or in one of PATH's full folders, never a relative one; a session runs that same full path, so the check and the start agree
CI / platforms (windows-latest) (push) Failing after 8s
CI / macos (push) Failing after 12m23s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-14 21:29:54 -04:00
1 parent 3e1535e921
commit 3c51b01955
4 files changed
+87 -33

No files matched your search

+6 -1
View File
@@ -77,7 +77,12 @@ pub fn launch(shell: &str, cwd: PathBuf, dir: &Path) -> anyhow::Result<Launch> {
let path = if shell.is_empty() {
default_shell()?
} else {
shell.to_string()
// The settings checked this path; the session runs no other.
let found = crate::settings::program_path(shell)
.with_context(|| format!("shell integration: {shell:?} names no program"))?;
(found.to_str())
.with_context(|| format!("shell integration: {} is not UTF-8", found.display()))?
.to_string()
};
let name = Path::new(&path)
.file_stem()
+8
View File
@@ -247,6 +247,14 @@ fn powershell_reports_its_folder_byte_for_byte_and_keeps_the_status() {
run.finish();
}
#[test]
fn a_shell_named_bare_runs_from_its_full_path() {
let started = launch("sh", PathBuf::from("/"), Path::new("/nonexistent")).expect("a launch");
let (program, _) = started.program.expect("a program");
assert!(Path::new(&program).is_absolute(), "{program}");
assert!(launch("no-such-shell", PathBuf::from("/"), Path::new("/")).is_err());
}
#[test]
fn an_unknown_shell_starts_without_integration() {
let dir = PathBuf::from("/nonexistent");