mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 11:22:52 +08:00
fish_title: Shorten command to 20 characters
Otherwise this makes massive terminal tabs
This commit is contained in:
parent
84e7fbd466
commit
0afb9b5709
|
@ -4,14 +4,14 @@ function fish_title
|
|||
# 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 -- $argv[1] (prompt_pwd -d 1 -D 0)
|
||||
echo -- (string sub -l 20 -- $argv[1]) (prompt_pwd -d 1 -D 0)
|
||||
else
|
||||
# Don't print "fish" because it's redundant
|
||||
set -l command (status current-command)
|
||||
if test "$command" = fish
|
||||
set command
|
||||
end
|
||||
echo -- $command (prompt_pwd -d 1 -D 1)
|
||||
echo -- (string sub -l 20 -- $command) (prompt_pwd -d 1 -D 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user