mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-26 14:01:13 -03:00
Some modern terminals allow creating tabs in a single window; this functionality has a lot of overlap with what a window manager already provides, so I'm not sure if it's a good idea. Regardless, a lot of people still use terminal tabs (or even multiple levels of tabs via tmux!), so let's add a fish-native way to set the tab title independent of the window title. Closes #2692
27 lines
641 B
Fish
27 lines
641 B
Fish
# vim: set filetype=fish sw=4 ts=4 et:
|
|
|
|
set -g prompt_counter 0
|
|
set -g prompt_counter_incr 0
|
|
function fish_prompt
|
|
if test $prompt_counter_incr -eq 1
|
|
set -g prompt_counter (math $prompt_counter + 1)
|
|
set -g prompt_counter_incr 0
|
|
end
|
|
echo "prompt $prompt_counter>"
|
|
end
|
|
function fish_prompt_event --on-event fish_prompt
|
|
set -g prompt_counter_incr 1
|
|
end
|
|
|
|
set -g fish_greeting ''
|
|
|
|
function fish_title
|
|
end
|
|
if functions -q fish_tab_title
|
|
echo >&2 'ERROR: fish_tab_title unexpectedly defined in test environment'
|
|
end
|
|
|
|
function _marker -d '_marker string - prints @MARKER:$string@'
|
|
echo "@MARKER:$argv[1]@"
|
|
end
|