0

I'm new to using the Fish shell; however, I'm observing some strange behaviour when I navigate between directories.

Below is the output of my shell.

Initially, all commands are prepended with ~; however, I've discovered that when I enter into certain directories, the commands are all prepended with > instead.

& user @ computer in ~/dev 0 [19:47:17]
~ cd souffle-example/                        0 [19:47:17]
> ls                                         0 [19:47:20]
edge.facts  example.dl  path.csv

Can someone explain why the shell enters a different "mode" when it enters certain directories and what do the different "modes" mean?

Edit:

After running type fish_prompt I get the following output:

fish_prompt is a function with definition
# Defined in /home/user/.config/fish/functions/fish_prompt.fish @ line 1
function fish_prompt
  # Cache exit status

  # Just calculate these once, to save a few cycles when displaying the prompt
  if not set -q __fish_prompt_hostname
    set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
  end
  if not set -q __fish_user
    switch (id -u)
      case 0
         set -g __fish_user '#'
      case '*'
         set -g __fish_user '&'
    end
  end
  set -g __fish_prompt_char '~'

  # Setup colors
  set -l normal (set_color normal)
  set -l white (set_color FFFFFF)
  set -l turquoise (set_color 5fdfff)
  set -l orange (set_color df5f00)
  set -l hotpink (set_color df005f)
  set -l blue (set_color 53D1ED)
  set -l green (set_color 87ff00)
  set -l greeno (set_color -o 87ff00)
  set -l purple (set_color af5fff)
  set -l red (set_color FF0000)
  set -l redo (set_color -o FF0000)
  set -l yellow (set_color E0D757)

  # Configure __fish_git_prompt
  set -g __fish_git_prompt_char_stateseparator ' '
  set -g __fish_git_prompt_color 5fdfff
  set -g __fish_git_prompt_color_flags df5f00
  set -g __fish_git_prompt_color_prefix white
  set -g __fish_git_prompt_color_suffix white
  set -g __fish_git_prompt_showdirtystate true
  set -g __fish_git_prompt_showuntrackedfiles true
  set -g __fish_git_prompt_showstashstate true
  set -g __fish_git_prompt_show_informative_status true

  # Env
  set -l last_status $status
  set -l __work_dir (string replace $HOME '~' (pwd))

  # Last status
  set -l __exit_code -1
  set -l __prompt 'y'
  if test $last_status -eq 0
    set __prompt $greeno$__fish_prompt_char$greeno' '
    set __exit_code $white'0'
  else
   set __prompt $redo'x '
   set __exit_code $redo$last_status
  end
  # Time
  set -l __time $white'['(date +%H:%M:%S)']'


  # Line
  echo -sne '\n'$purple$__fish_user' '$blue$USER$white \
    ' @ '$green$__fish_prompt_hostname$white \
    ' in '$yellow$__work_dir$turquoise \
    (__fish_git_prompt) \
    ' '$__exit_code \
    ' '$__time \
    '\n' \
    $__prompt;
end

The only extension I've installed is oh-my-fish and I have the "ays" theme activated via the omf install ays command.

9
  • What does type fish_prompt show? Commented Jun 24, 2021 at 12:51
  • When I enter type fish_prompt I get "fish_prompt is a function with definition ..."
    – ptk
    Commented Jun 24, 2021 at 13:52
  • 2
    Yes, and the definition is the interesting part. Please update your question with the details. Commented Jun 24, 2021 at 16:50
  • Right - That's definitely not the standard fish prompt that you are seeing. Have you installed any plugins or other customizations? Commented Jun 24, 2021 at 18:14
  • 1
    what version of fish are you running? I recall that if the prompt was wider than your terminal, then it would turn into '>', but I think that was for older versions. Can you experiment with a wider terminal? Commented Jun 25, 2021 at 16:27

0

You must log in to answer this question.

Browse other questions tagged .