mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Supress fish_title only for Terminal.app
VTE terminals apparently do not use the OSC sequence to compose title components.
This commit is contained in:
parent
dfe7813c02
commit
b2f047421d
1 changed files with 6 additions and 2 deletions
|
@ -220,14 +220,18 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
# Notify terminals when $PWD changes (issue #906)
|
# Notify terminals when $PWD changes (issue #906)
|
||||||
# VTE and Terminal.app support this in practice.
|
# VTE and Terminal.app support this in practice.
|
||||||
if test "0$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal"
|
if test "0$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal"
|
||||||
echo -n \e\]0\;\a # clear existing title
|
|
||||||
function fish_title; end
|
|
||||||
function __update_cwd_osc --on-variable PWD --description 'Notify capable terminals when $PWD changes'
|
function __update_cwd_osc --on-variable PWD --description 'Notify capable terminals when $PWD changes'
|
||||||
status --is-command-substitution
|
status --is-command-substitution
|
||||||
or test -n "$INSIDE_EMACS"
|
or test -n "$INSIDE_EMACS"
|
||||||
and return
|
and return
|
||||||
printf \e\]7\;file://\%s\%s\a (hostname) (echo -n $PWD | __fish_urlencode)
|
printf \e\]7\;file://\%s\%s\a (hostname) (echo -n $PWD | __fish_urlencode)
|
||||||
end
|
end
|
||||||
|
if test "$TERM_PROGRAM" = "Apple_Terminal"
|
||||||
|
# Suppress duplicative title display on Terminal.app
|
||||||
|
echo -n \e\]0\;\a # clear existing title
|
||||||
|
function fish_title
|
||||||
|
end
|
||||||
|
end
|
||||||
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue