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:
Aaron Gyes 2016-10-23 11:58:29 -07:00
parent dfe7813c02
commit b2f047421d

View file

@ -220,14 +220,18 @@ function __fish_config_interactive -d "Initializations that should be performed
# Notify terminals when $PWD changes (issue #906)
# VTE and Terminal.app support this in practice.
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'
status --is-command-substitution
or test -n "$INSIDE_EMACS"
and return
printf \e\]7\;file://\%s\%s\a (hostname) (echo -n $PWD | __fish_urlencode)
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
end