0

I have been using fish shell for a while, but only recently got into playing around with the oh-my-fish framework and theming the prompt.

I cannot figure out what this [I] character means! In most themes I install it comes at the very beginning of the prompt, but depending it can be elsewhere.

In my fish_prompt.fish file I see this function:

function fish_prompt -d 'Write out the left prompt of the dangerous theme'
  set -g last_status $status
  echo -n -s (__dangerous_prompt_bindmode) (__dangerous_prompt_git_branch) (__dangerous_prompt_left_symbols) ' '
end

I cannot figure out what is causing the [I]. I am using the dangerous theme if that matters (however, I see the [I] in all of the themes)

I would love if someone can shed some light on this for me! Thanks.

3

The [I] signifies "Vi Insert Mode" when the shell is in Vi command line editing mode.

This changes to [N] when you press Esc to enter "Vi Normal Mode" (also sometimes referred to as "Vi Command Mode").

This may be a bug if you did not explicitly put your shell into Vi mode. The bug has previously been reported here: https://github.com/fish-shell/fish-shell/issues/3201

The solution (to remove the [I]) is to use

function fish_mode_prompt
end

in your fish configuration file.

  • Oh wow. That explains it. I don't use Vi. Should it be showing even when I am not running vi? – Jordan Rhea Apr 26 '18 at 9:46
  • @JordanRhea The command line editor, what you use to change things on the command line, is in "vi-mode". This does not mean that you are using the Vi editor. – Kusalananda Apr 26 '18 at 9:49
  • @JordanRhea See updated answer. – Kusalananda Apr 26 '18 at 9:55
  • Perfect. One last thing to add. You can run the function on the command line and then save it with funcsave fish_mode_prompt – Jordan Rhea Apr 26 '18 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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