fix(terminal): use fish's hostname variable for OSC 7 (#4050)

The fish prompt hook ran the external hostname command to build the OSC 7
working-directory URL, so fish printed an error at every prompt where that
command is unavailable. It now uses fish's built-in \$hostname variable.

Closes #4046

Co-authored-by: cubelitblade <135247075+cubelitblade@users.noreply.github.com>
This commit is contained in:
Ray Liang
2026-11-18 08:37:55 +08:00
committed by GitHub
co-authored by cubelitblade
parent c1782f01eb
commit c1f3debbb9
+1 -1
View File
@@ -83,7 +83,7 @@ esac
"#;
const FISH_INIT: &str = concat!(
r#"function __openidea_osc7 --on-event fish_prompt; printf '\e]133;D;%s\a\e]7;file://%s%s\a' "$status" (hostname) $PWD; end; "#,
r#"function __openidea_osc7 --on-event fish_prompt; printf '\e]133;D;%s\a\e]7;file://%s%s\a' "$status" "$hostname" $PWD; end; "#,
r#"function __openidea_preexec --on-event fish_preexec; printf '\e]133;C\a'; end"#,
);