diff options
author | Malfurious <m@lfurio.us> | 2023-05-22 11:17:56 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2023-05-23 17:18:53 -0400 |
commit | 6494be5723898aadf35ac27a64b05a42ea5a7c9b (patch) | |
tree | 0f63e8bcfa6d79871146ba8e85e8ae26b4096e5a | |
parent | e6c5c54f2aeb659bff86f628fe80940c9bb7fd03 (diff) | |
download | rice-6494be5723898aadf35ac27a64b05a42ea5a7c9b.tar.gz rice-6494be5723898aadf35ac27a64b05a42ea5a7c9b.zip |
fish: Update prompt
Remove user@host, except during SSH sessions.
-rw-r--r-- | .config/fish/functions/fish_prompt.fish | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish index 762a448..06b4309 100644 --- a/.config/fish/functions/fish_prompt.fish +++ b/.config/fish/functions/fish_prompt.fish @@ -1,22 +1,16 @@ function fish_prompt --description 'Write out the prompt' - set -l normal (set_color normal) - set -l color_cwd $fish_color_cwd - set -l color_host $fish_color_host - set -l suffix '>' + set -l color_cwd (set_color $fish_color_cwd) + set -l color_host (set_color $fish_color_host_remote) + set -l reset (set_color normal) - # Color the prompt differently when we're root - if contains -- $USER root toor - if set -q fish_color_cwd_root - set color_cwd $fish_color_cwd_root - end - set suffix '#' - end + set -l hostinfo '' + set -l suffix '$' - # If we're running via SSH, change the host color + # If we're running via SSH, display the hostname and change color. if set -q SSH_TTY - set color_host $fish_color_host_remote + set hostinfo $color_host $USER @ (prompt_hostname) $reset " " end - echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' \ - (set_color $color_cwd) (prompt_pwd) $normal (git-sonar -f) $normal " " $suffix " " + # prompt + echo -n -s $hostinfo $color_cwd (prompt_pwd) $reset (git-sonar -f) $reset " " $suffix " " end |