diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 209cdd1ca..0b2fc8063 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -271,18 +271,14 @@ function __fish_config_interactive -d "Initializations that should be performed end # Notify terminals when $PWD changes (issue #906). - # VTE based terminals, Terminal.app, and iTerm.app support this. - set -q VTE_VERSION - or set -l VTE_VERSION 0 - set -q TERM_PROGRAM - or set -l TERM_PROGRAM - if test "$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal" + # VTE based terminals, Terminal.app , and iTerm.app support this. + if test 0"$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal" -a 0"$TERM_PROGRAM_VERSION" -ge 309 function __update_cwd_osc --on-variable PWD --description 'Notify capable terminals when $PWD changes' if status --is-command-substitution or set -q INSIDE_EMACS return end - printf \e\]7\;file://\%s\%s\a $hostname (string escape --style=url $PWD) + printf \e\]7\;file://%s%s\a $hostname (string escape --style=url $PWD) end __update_cwd_osc # Run once because we might have already inherited a PWD from an old tab end