1

Update fish_title to be Fish 2.X.X compatible

This commit is contained in:
Jessie Hildebrandt 2019-11-04 10:17:09 +00:00
parent aa51ade346
commit df240b36e2

View File

@ -14,7 +14,7 @@
# * Abbreviated + colorized working directory # * Abbreviated + colorized working directory
# * VCS status # * VCS status
# * Dynamic prompt character (root/user, return status) # * Dynamic prompt character (root/user, return status)
# * Dynamic greeting function () # * Dynamic greeting function
# * Optional timestamps # * Optional timestamps
# #
# Configurable variables: # Configurable variables:
@ -131,9 +131,19 @@ function fish_title --description 'Print the title of the window'
return return
end end
# Set title to the command status + working directory # Set window title to the current command + working directory
if test (echo $FISH_VERSION | cut -d "." -f 1) -ge 3
# Fish 3.X.X and above use "status current-command"
echo (status current-command) (__fish_pwd) echo (status current-command) (__fish_pwd)
else
# Older versions of fish use the "$_" variable
echo $_ (__fish_pwd)
end
end end
################### ###################