T16: on Windows a shell named without an extension means its .exe, and one with an extension keeps it; the resolver hands the session its program as UTF-8 text, so a program whose path is not UTF-8 never saves
This commit is contained in:
4 files changed
+94
-42
No files matched your search
+1
-5
@@ -78,11 +78,7 @@ pub fn launch(shell: &str, cwd: PathBuf, dir: &Path) -> anyhow::Result<Launch> {
|
||||
default_shell()?
|
||||
} else {
|
||||
// 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()
|
||||
crate::settings::program_path(shell).context("shell integration")?
|
||||
};
|
||||
let name = Path::new(&path)
|
||||
.file_stem()
|
||||
|
||||
@@ -251,6 +251,7 @@ fn powershell_reports_its_folder_byte_for_byte_and_keeps_the_status() {
|
||||
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_eq!(program, crate::settings::program_path("sh").expect("sh"));
|
||||
assert!(Path::new(&program).is_absolute(), "{program}");
|
||||
assert!(launch("no-such-shell", PathBuf::from("/"), Path::new("/")).is_err());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user