Last active
October 27, 2022 21:08
-
-
Save CocoaBeans/4550321 to your computer and use it in GitHub Desktop.
Fish shell custom prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################################## | |
### Fish Custom Overrides | |
### Creates a shell prompt in the form of: | |
### | |
### ----------------------------------------------------------------------- 11:56:05 | |
### kevin@kross /S/L/F/C/V/A/F/L/V/A/Support > | |
######################################################################################## | |
set --global fish_prompt_username_color 555555 | |
set --global fish_prompt_hostname_color 555555 | |
#trap "echo -ne " WINCH | |
# Override fish_prompt | |
function fish_prompt -d "Write out the prompt" | |
set marker (fish_prompt_line_marker) | |
echo $marker | |
set prompt (printf '%s%s%s@%s%s%s %s%s > ' (set_color $fish_prompt_username_color) (whoami) (set_color normal) (set_color $fish_prompt_hostname_color) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)) | |
echo -n $prompt | |
end | |
function --on-signal WINCH fish_prompt_line_marker_signal_handler | |
#set marker (fish_prompt_line_marker) | |
printf "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" | |
# echo (fish_prompt_line_marker) | |
# echo -n '' | |
; | |
end | |
# function --on-event fish_prompt fish_prompt_line_marker_event_handler | |
# set marker (fish_prompt_line_marker) | |
# echo (fish_prompt_line_marker) | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment