mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00: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:
parent
f479e4a830
commit
376a4eca58
4 changed files with 15 additions and 15 deletions
|
@ -4,10 +4,10 @@
|
||||||
function fish_prompt -d "Write out the prompt"
|
function fish_prompt -d "Write out the prompt"
|
||||||
set laststatus $status
|
set laststatus $status
|
||||||
function _git_branch_name
|
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
|
end
|
||||||
function _is_git_dirty
|
function _is_git_dirty
|
||||||
echo (git status -s --ignore-submodules=dirty ^/dev/null)
|
echo (git status -s --ignore-submodules=dirty 2>/dev/null)
|
||||||
end
|
end
|
||||||
if [ (_git_branch_name) ]
|
if [ (_git_branch_name) ]
|
||||||
set -l git_branch (set_color -o blue)(_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"
|
function __fish_repaint_user --on-variable fish_color_user --description "Event handler, repaint when fish_color_user changes"
|
||||||
if status --is-interactive
|
if status --is-interactive
|
||||||
commandline -f repaint ^/dev/null
|
commandline -f repaint 2>/dev/null
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_repaint_host --on-variable fish_color_host --description "Event handler, repaint when fish_color_host changes"
|
function __fish_repaint_host --on-variable fish_color_host --description "Event handler, repaint when fish_color_host changes"
|
||||||
if status --is-interactive
|
if status --is-interactive
|
||||||
commandline -f repaint ^/dev/null
|
commandline -f repaint 2>/dev/null
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_repaint_status --on-variable fish_color_status --description "Event handler; repaint when fish_color_status changes"
|
function __fish_repaint_status --on-variable fish_color_status --description "Event handler; repaint when fish_color_status changes"
|
||||||
if status --is-interactive
|
if status --is-interactive
|
||||||
commandline -f repaint ^/dev/null
|
commandline -f repaint 2>/dev/null
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_repaint_bind_mode --on-variable fish_key_bindings --description "Event handler; repaint when fish_key_bindings changes"
|
function __fish_repaint_bind_mode --on-variable fish_key_bindings --description "Event handler; repaint when fish_key_bindings changes"
|
||||||
if status --is-interactive
|
if status --is-interactive
|
||||||
commandline -f repaint ^/dev/null
|
commandline -f repaint 2>/dev/null
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,36 +7,36 @@ function fish_prompt
|
||||||
if not set -q -g __fish_robbyrussell_functions_defined
|
if not set -q -g __fish_robbyrussell_functions_defined
|
||||||
set -g __fish_robbyrussell_functions_defined
|
set -g __fish_robbyrussell_functions_defined
|
||||||
function _git_branch_name
|
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]
|
if set -q branch[1]
|
||||||
echo (string replace -r '^refs/heads/' '' $branch)
|
echo (string replace -r '^refs/heads/' '' $branch)
|
||||||
else
|
else
|
||||||
echo (git rev-parse --short HEAD ^/dev/null)
|
echo (git rev-parse --short HEAD 2>/dev/null)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _is_git_dirty
|
function _is_git_dirty
|
||||||
echo (git status -s --ignore-submodules=dirty ^/dev/null)
|
echo (git status -s --ignore-submodules=dirty 2>/dev/null)
|
||||||
end
|
end
|
||||||
|
|
||||||
function _is_git_repo
|
function _is_git_repo
|
||||||
type -q git
|
type -q git
|
||||||
or return 1
|
or return 1
|
||||||
git status -s >/dev/null ^/dev/null
|
git status -s >/dev/null 2>/dev/null
|
||||||
end
|
end
|
||||||
|
|
||||||
function _hg_branch_name
|
function _hg_branch_name
|
||||||
echo (hg branch ^/dev/null)
|
echo (hg branch 2>/dev/null)
|
||||||
end
|
end
|
||||||
|
|
||||||
function _is_hg_dirty
|
function _is_hg_dirty
|
||||||
echo (hg status -mard ^/dev/null)
|
echo (hg status -mard 2>/dev/null)
|
||||||
end
|
end
|
||||||
|
|
||||||
function _is_hg_repo
|
function _is_hg_repo
|
||||||
type -q hg
|
type -q hg
|
||||||
or return 1
|
or return 1
|
||||||
hg summary >/dev/null ^/dev/null
|
hg summary >/dev/null 2>/dev/null
|
||||||
end
|
end
|
||||||
|
|
||||||
function _repo_branch_name
|
function _repo_branch_name
|
||||||
|
|
|
@ -16,7 +16,7 @@ function fish_right_prompt
|
||||||
test $status != 0
|
test $status != 0
|
||||||
and printf (set_color red)"⏎ "
|
and printf (set_color red)"⏎ "
|
||||||
|
|
||||||
if git rev-parse ^/dev/null
|
if git rev-parse 2>/dev/null
|
||||||
# Magenta if branch detached else green
|
# Magenta if branch detached else green
|
||||||
git branch -qv | grep "\*" | string match -rq detached
|
git branch -qv | grep "\*" | string match -rq detached
|
||||||
and set_color brmagenta
|
and set_color brmagenta
|
||||||
|
@ -26,7 +26,7 @@ function fish_right_prompt
|
||||||
git name-rev --name-only HEAD
|
git name-rev --name-only HEAD
|
||||||
|
|
||||||
# Merging state
|
# Merging state
|
||||||
git merge -q ^/dev/null
|
git merge -q 2>/dev/null
|
||||||
or printf ':'(set_color red)'merge'
|
or printf ':'(set_color red)'merge'
|
||||||
printf ' '
|
printf ' '
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue