2018-05-12 19:53:45 +08:00
|
|
|
function fish_title
|
2024-04-03 19:06:17 +08:00
|
|
|
# If we're connected via ssh, we print the hostname.
|
|
|
|
set -l ssh
|
|
|
|
set -q SSH_TTY
|
|
|
|
and set ssh "["(prompt_hostname | string sub -l 10 | string collect)"]"
|
|
|
|
# An override for the current command is passed as the first parameter.
|
|
|
|
# This is used by `fg` to show the true process name, among others.
|
|
|
|
if set -q argv[1]
|
|
|
|
echo -- $ssh (string sub -l 20 -- $argv[1]) (prompt_pwd -d 1 -D 1)
|
|
|
|
else
|
|
|
|
# Don't print "fish" because it's redundant
|
|
|
|
set -l command (status current-command)
|
|
|
|
if test "$command" = fish
|
|
|
|
set command
|
2022-01-16 18:14:11 +08:00
|
|
|
end
|
2024-04-03 19:06:17 +08:00
|
|
|
echo -- $ssh (string sub -l 20 -- $command) (prompt_pwd -d 1 -D 1)
|
2019-05-06 23:06:40 +08:00
|
|
|
end
|
2018-05-12 19:53:45 +08:00
|
|
|
end
|