Skip to content

Instantly share code, notes, and snippets.

@CocoaBeans
Last active Dec 11, 2015
Embed
What would you like to do?
Fish shell custom prompt
########################################################################################
### 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