mirror of
https://github.com/Steffo99/config-fish.git
synced 2024-12-22 14:54:23 +00:00
Fix fish prompt
This commit is contained in:
parent
2d0afe54a7
commit
db8f37bdb6
1 changed files with 14 additions and 4 deletions
|
@ -36,11 +36,21 @@ function fish_prompt
|
||||||
|
|
||||||
|
|
||||||
# Hostname
|
# Hostname
|
||||||
if test -z "$SSH_CLIENT"
|
set -g CURRENT_IP (who am i | awk '{print $5}')
|
||||||
set_color green
|
|
||||||
else
|
if test -z "$CURRENT_IP"
|
||||||
set_color cyan
|
# Experiment
|
||||||
|
set -g CURRENT_IP (who | grep "$USER" | awk '{print $5}')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if test "$CURRENT_IP" "=" "(:0)"
|
||||||
|
set_color green
|
||||||
|
else if test -n "$SSH_CLIENT"
|
||||||
|
set_color cyan
|
||||||
|
else
|
||||||
|
set_color magenta
|
||||||
|
end
|
||||||
|
|
||||||
echo -n (prompt_hostname)
|
echo -n (prompt_hostname)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue