function __bcarlin_prompt_suffix
  set -l color_suffix
  set -l suffix "➜"

  switch $USER
    case root toor
      if set -q fish_color_cwd_root
		echo root if
        set color_suffix $fish_color_cwd_root
      else
        set color_suffix $fish_color_cwd
      end
    case '*'
      set color_suffix $fish_color_cwd
  end

  echo -n -s ' ' (set_color $color_suffix --bold) "$suffix" (set_color normal) ' '
end

function __bcarlin_prompt_venv
  if test -n "$VIRTUAL_ENV"
    set -l venv_name (basename $VIRTUAL_ENV)
    if test $venv_name = '.venv'
      set venv_name (basename (dirname $VIRTUAL_ENV))
    end
	echo -n -s (set_color blue --bold) "(" $venv_name ") " (set_color normal)
  end
end

function fish_prompt --description 'Write out the prompt'
  set -l last_status $status
  set -l _pwd (set_color $fish_color_cwd) (prompt_pwd)

  echo -n -s (__bcarlin_prompt_venv)
  echo -n -s "$USER" @ (prompt_hostname) ' ' $_pwd
  echo -n -s (__fish_git_prompt)
  if test $last_status -ne 0
      echo -n -s (set_color red --bold)" [$last_status]" (set_color normal)
  end
  echo -n -s (__bcarlin_prompt_suffix)
end
