I'm trying to have the user@hostname displayed all the time in fish's bobthefish theme, no matter whether you're the default user or not. I've tried editing ~/.config/fish/functions/fish_prompt.fish, which has the following section:

function __bobthefish_prompt_user -S -d 'Display actual user if different from $default_user'
  if [ "$theme_display_user" = 'yes' ]
    if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ]
      __bobthefish_start_segment $__color_username
      set -l IFS .
      hostname | read -l hostname __
      echo -ns (whoami) '@' $hostname ' '
    end
  end
end

I've tried removing lines 3 and 8 then restarting the terminal to no avail. It seems that simple on first sight, but then again, I don't really understand -o -n "$SSH_CLIENT" either.

Thanks in advance!

-o -n "$SSH_CLIENT" means: or (-o) the variable $SSH_CLIENT contains a string (-n "$SSH_CLIENT")

$SSH_CLIENT is set if you are logged in via SSH. So the user@hostname will always be displayed if you are logged in remotely.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.