configs  Artifact [ec0f8ebd8c]

Artifact ec0f8ebd8ce936112788a7a14eba4d3f826ac4dd313760d368e3ee1d2aae1329:

  • File config/fish/functions/fish_prompt.fish — part of check-in [efaabe0fb7] at 2020-01-22 20:44:39 on branch trunk — fish: Restore color after prompt (user: js size: 696)

function fish_prompt --description 'Write out the prompt'
	set -l suffix
	switch "$USER"
		case root toor
			set suffix (set_color ff0000)'#'
		case '*'
			set suffix '>'
	end

	set -l branch (git symbolic-ref HEAD 2>/dev/null)
	set branch (string replace -r "^refs/heads/" "" $branch)
	set -l vcs
	if test -n "$branch" -a "$branch" != "master"
		set vcs (set_color $fish_color_vcs_braces)"(" \
		    (set_color $fish_color_vcs)"$branch" \
		    (set_color $fish_color_vcs_braces)")"
	end

	echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \
	    (set_color $fish_color_cwd) (prompt_pwd) (string join '' $vcs) \
	    (set_color $fish_color_suffix) $suffix (set_color normal) ' '
end