mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 08:56:43 +08:00
Shorten default title
This now skips the "fish" bit and uses prompt_pwd to print a shorter title. See #8641.
This commit is contained in:
parent
ca12ce2494
commit
698b818935
|
@ -115,6 +115,7 @@ Interactive improvements
|
|||
- The clipboard bindings ignore X-based clipboard programs if the ``DISPLAY`` environment variable is not set, which helps prefer the Windows clipboard when it is available (such as on WSL).
|
||||
- ``funcsave`` will remove a saved copy of a function that has been erased with ``functions --erase``.
|
||||
- The Web-based configuration tool gained a number of improvements, including the ability to set pager colors.
|
||||
- The default ``fish_title`` prints a shorter title with shortened $PWD and no more redundant "fish" (:issue:`8641`).
|
||||
|
||||
New or improved bindings
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -3,6 +3,15 @@ function fish_title
|
|||
if not set -q INSIDE_EMACS; or string match -vq '*,term:*' -- $INSIDE_EMACS
|
||||
# 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.
|
||||
echo (set -q argv[1] && echo $argv[1] || status current-command) (__fish_pwd)
|
||||
if set -q argv[1]
|
||||
echo -- $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)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user