Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fish: Unknown command: fish_right_prompt #74

Open
kalip2 opened this issue Feb 3, 2024 · 9 comments
Open

fish: Unknown command: fish_right_prompt #74

kalip2 opened this issue Feb 3, 2024 · 9 comments

Comments

@kalip2
Copy link

kalip2 commented Feb 3, 2024

Trying to install your plugin with fisher gives me this error:

❯ fisher --version
fisher, version 4.4.3
❯ fish --version
fish, version 3.7.0
❯ fisher install acomagu/fish-async-prompt
fisher install version 4.4.3
Fetching https://api.github.com/repos/acomagu/fish-async-prompt/tarball/HEAD
Installing acomagu/fish-async-prompt
           /Users/akshatpradhan/.config/fish/conf.d/__async_prompt.fish
Installed 1 plugin/s
fish: Unknown command: fish_right_prompt
fish: 
    fish_right_prompt | read -z prompt
    ^~~~~~~~~~~~~~~~^
@acomagu
Copy link
Owner

acomagu commented Feb 4, 2024

@kalip2 What is your output of this command: functions -q fish_right_prompt

@acomagu
Copy link
Owner

acomagu commented Feb 4, 2024

And could you provide your plugin list and config.fish?

@kalip2
Copy link
Author

kalip2 commented Feb 9, 2024

@acomagu More output as you requested

❯ fisher install acomagu/fish-async-prompt
fisher install version 4.4.4
Fetching https://api.github.com/repos/acomagu/fish-async-prompt/tarball/HEAD
Installing acomagu/fish-async-prompt
           /Users/akshatpradhan/.config/fish/conf.d/__async_prompt.fish
Installed 1 plugin/s
fish: Unknown command: fish_right_prompt
fish: 
    fish_right_prompt | read -z prompt
    ^~~~~~~~~~~~~~~~^
❯ functions -q fish_right_prompt
functions: -q: unknown option
❯ fisher list
jorgebucaran/autopair.fish
meaningful-ooo/sponge
ilancosman/tide@v6
gazorby/fish-abbreviation-tips
patrickf1/fzf.fish
jamiesteven/fish-plugin-lsd
franciscolourenco/done
markcial/upto
oh-my-fish/plugin-pj
patrickf1/colored_man_pages.fish
otms61/fish-pet
joseluisq/[email protected]
❯ bat -pp .config/fish/config.fish

if status is-interactive
  # Commands to run in interactive sessions can go here
  eval "$(/opt/homebrew/bin/brew shellenv)"
  set -gx EDITOR 'code --wait'
  set -gx VISUAL 'code --wait --new-window'
  set -gx PROJECT_PATHS ~/Code # for oh-my-fish/plugin-pj
  set fish_greeting
  set fzf_preview_dir_cmd lsd --all --color=always # for PatrickF1/fzf.fish
  thefuck --alias | source 
  zoxide init fish | source
  # op completion fish | source
  # rbenv init - | source
  # pyenv init - | source
end

@LRNZ09
Copy link

LRNZ09 commented Jul 17, 2024

The error probably occurs because your current setup and/or theme doesn't implement the right prompt.

I resolved this issue by explicitly setting the async functions to only use fish_prompt, overriding the default. You can do this by running the following command once in your shell, as shown in the README:

set -U async_prompt_functions fish_prompt

This command sets the universal variable async_prompt_functions to use only fish_prompt, which should prevent the error related to fish_right_prompt.

@injust
Copy link

injust commented Jul 17, 2024

I also ran into this. If you're using starship, starship init fish | source might be in an if status is-interactive check. Moving it outside should fix it.

@LRNZ09 I think that doesn't match up with your explanation, because /usr/local/bin/starship init fish --print-full-init does have a fish_right_prompt function.

@LRNZ09
Copy link

LRNZ09 commented Jul 17, 2024

I think there might be a mix-up. I’m not using Starship or other themes for my Fish shell.

I know that Starship offers additional prompt configuration options, but my issue revolves around the standard Fish prompt and a few other plugins; this understanding led me to propose my solution.

@injust
Copy link

injust commented Jul 17, 2024

I think there might be a mix-up. I’m not using Starship or other themes for my Fish shell.

I know that Starship offers additional prompt configuration options, but my issue revolves around the standard Fish prompt and a few other plugins; this understanding led me to propose my solution.

@LRNZ09 I understand that not everyone experiencing this issue is using Starship. But when I tried it with Starship, I ran into this issue, even though Starship sets fish_right_prompt.

So maybe this issue isn't as simple as "your current setup and/or theme doesn't implement the right prompt".

@injust
Copy link

injust commented Jul 17, 2024

I think https://www.reddit.com/r/fishshell/comments/vnal1x/comment/ie656h7/ is the explanation here?

fish-async-prompt starts a new fish process to do stuff. If you have defined your fish_right_prompt only when fish is interactive, that would break.

Also make sure you've updated fish-async-prompt recently because it had an issue that had symptoms like this.

@LRNZ09
Copy link

LRNZ09 commented Jul 17, 2024

Probably the plugin will need some changes because, in your situation, having Starship loaded even when the shell is non-interactive seems unfit to me.

For instance, you may have it loaded with a fish shell script where a theme is not really necessary and might slow down the whole thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants