mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
sample_prompts/debian_chroot: Clean
- Remove begin/end in if-conditions - this used to be necessary in fish < 2.3.0 - Quote a `test`
This commit is contained in:
parent
bcfef9268d
commit
b794a5e476
1 changed files with 5 additions and 12 deletions
|
@ -11,17 +11,13 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
|
||||||
end
|
end
|
||||||
|
|
||||||
# Set variable identifying the chroot you work in (used in the prompt below)
|
# Set variable identifying the chroot you work in (used in the prompt below)
|
||||||
if begin
|
if not set -q debian_chroot
|
||||||
not set -q debian_chroot
|
and test -r /etc/debian_chroot
|
||||||
and test -r /etc/debian_chroot
|
|
||||||
end
|
|
||||||
set debian_chroot (cat /etc/debian_chroot)
|
set debian_chroot (cat /etc/debian_chroot)
|
||||||
end
|
end
|
||||||
if begin
|
if not set -q __fish_debian_chroot_prompt
|
||||||
not set -q __fish_debian_chroot_prompt
|
and set -q debian_chroot
|
||||||
and set -q debian_chroot
|
and test -n "$debian_chroot"
|
||||||
and test -n $debian_chroot
|
|
||||||
end
|
|
||||||
set -g __fish_debian_chroot_prompt "($debian_chroot)"
|
set -g __fish_debian_chroot_prompt "($debian_chroot)"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,9 +27,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
|
||||||
end
|
end
|
||||||
|
|
||||||
switch "$USER"
|
switch "$USER"
|
||||||
|
|
||||||
case root toor
|
case root toor
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
if set -q fish_color_cwd_root
|
if set -q fish_color_cwd_root
|
||||||
set -g __fish_prompt_cwd (set_color $fish_color_cwd_root)
|
set -g __fish_prompt_cwd (set_color $fish_color_cwd_root)
|
||||||
|
@ -45,7 +39,6 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
|
||||||
echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" '# '
|
echo -n -s "$USER" @ (prompt_hostname) ' ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" '# '
|
||||||
|
|
||||||
case '*'
|
case '*'
|
||||||
|
|
||||||
if not set -q __fish_prompt_cwd
|
if not set -q __fish_prompt_cwd
|
||||||
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue