mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 23:11:14 -03:00
Remove ^ redirection from sample prompts
A bunch of these did ^/dev/null. Replace it with 2>/dev/null. [ci skip]
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
function fish_prompt -d "Write out the prompt"
|
||||
set laststatus $status
|
||||
function _git_branch_name
|
||||
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
|
||||
echo (git symbolic-ref HEAD 2>/dev/null | sed -e 's|^refs/heads/||')
|
||||
end
|
||||
function _is_git_dirty
|
||||
echo (git status -s --ignore-submodules=dirty ^/dev/null)
|
||||
echo (git status -s --ignore-submodules=dirty 2>/dev/null)
|
||||
end
|
||||
if [ (_git_branch_name) ]
|
||||
set -l git_branch (set_color -o blue)(_git_branch_name)
|
||||
|
||||
@@ -12,25 +12,25 @@ function fish_prompt --description 'Write out the prompt'
|
||||
|
||||
function __fish_repaint_user --on-variable fish_color_user --description "Event handler, repaint when fish_color_user changes"
|
||||
if status --is-interactive
|
||||
commandline -f repaint ^/dev/null
|
||||
commandline -f repaint 2>/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_repaint_host --on-variable fish_color_host --description "Event handler, repaint when fish_color_host changes"
|
||||
if status --is-interactive
|
||||
commandline -f repaint ^/dev/null
|
||||
commandline -f repaint 2>/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_repaint_status --on-variable fish_color_status --description "Event handler; repaint when fish_color_status changes"
|
||||
if status --is-interactive
|
||||
commandline -f repaint ^/dev/null
|
||||
commandline -f repaint 2>/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_repaint_bind_mode --on-variable fish_key_bindings --description "Event handler; repaint when fish_key_bindings changes"
|
||||
if status --is-interactive
|
||||
commandline -f repaint ^/dev/null
|
||||
commandline -f repaint 2>/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -7,36 +7,36 @@ function fish_prompt
|
||||
if not set -q -g __fish_robbyrussell_functions_defined
|
||||
set -g __fish_robbyrussell_functions_defined
|
||||
function _git_branch_name
|
||||
set -l branch (git symbolic-ref --quiet HEAD ^/dev/null)
|
||||
set -l branch (git symbolic-ref --quiet HEAD 2>/dev/null)
|
||||
if set -q branch[1]
|
||||
echo (string replace -r '^refs/heads/' '' $branch)
|
||||
else
|
||||
echo (git rev-parse --short HEAD ^/dev/null)
|
||||
echo (git rev-parse --short HEAD 2>/dev/null)
|
||||
end
|
||||
end
|
||||
|
||||
function _is_git_dirty
|
||||
echo (git status -s --ignore-submodules=dirty ^/dev/null)
|
||||
echo (git status -s --ignore-submodules=dirty 2>/dev/null)
|
||||
end
|
||||
|
||||
function _is_git_repo
|
||||
type -q git
|
||||
or return 1
|
||||
git status -s >/dev/null ^/dev/null
|
||||
git status -s >/dev/null 2>/dev/null
|
||||
end
|
||||
|
||||
function _hg_branch_name
|
||||
echo (hg branch ^/dev/null)
|
||||
echo (hg branch 2>/dev/null)
|
||||
end
|
||||
|
||||
function _is_hg_dirty
|
||||
echo (hg status -mard ^/dev/null)
|
||||
echo (hg status -mard 2>/dev/null)
|
||||
end
|
||||
|
||||
function _is_hg_repo
|
||||
type -q hg
|
||||
or return 1
|
||||
hg summary >/dev/null ^/dev/null
|
||||
hg summary >/dev/null 2>/dev/null
|
||||
end
|
||||
|
||||
function _repo_branch_name
|
||||
|
||||
@@ -16,7 +16,7 @@ function fish_right_prompt
|
||||
test $status != 0
|
||||
and printf (set_color red)"⏎ "
|
||||
|
||||
if git rev-parse ^/dev/null
|
||||
if git rev-parse 2>/dev/null
|
||||
# Magenta if branch detached else green
|
||||
git branch -qv | grep "\*" | string match -rq detached
|
||||
and set_color brmagenta
|
||||
@@ -26,7 +26,7 @@ function fish_right_prompt
|
||||
git name-rev --name-only HEAD
|
||||
|
||||
# Merging state
|
||||
git merge -q ^/dev/null
|
||||
git merge -q 2>/dev/null
|
||||
or printf ':'(set_color red)'merge'
|
||||
printf ' '
|
||||
|
||||
|
||||
Reference in New Issue
Block a user