You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after selecting the 'Robbyrussell' prompt from the fish_config web interface, the shell displays errors:
fish: Unknown command '_git_branch_name'
/Users/james/.config/fish/functions/fish_prompt.fish (line 2): _git_branch_name
^
in command substitution
called on line 11 of file '/Users/james/.config/fish/functions/fish_prompt.fish',
in function 'fish_prompt',
called on standard input,
in command substitution
called on standard input,
manually copy / pasting the displayed code into fish_prompt.fish works fine, as does using the 'Classic + Git' prompt
The Classic+Git prompt doesn't throw errors immediately, but as far as I can tell its functions are not copied over successfully either. This is indeed a bug or limitation of the webconfig.py script: it propagates the fish_prompt function alone, not the entire file from which it came.
For fish 2.0, I'm going to add an ugly hack to move the relevant function definitions inside fish_prompt, so they get copied over. For a future release we should teach webconfig.py how to copy over the file.
This is not fixed properly; however as of b722e9a none of the sample prompts define function outside of fish_prompt, so it's worked around. That commit will be in 3.2.
No, it's just easier. Modifying webconfig.py is the right approach but would have to duplicate some work done by funcsave, like fetching $__fish_config_dir and creating the functions directory. If you or anyone has the appetite for it then we'd love to merge a PR.
Activity
sugar700 commentedon May 12, 2013
The problem is that
fish_configonly copiesfish_prompt. It's a bug.aeosynth commentedon May 12, 2013
edit: ok
ridiculousfish commentedon May 13, 2013
The Classic+Git prompt doesn't throw errors immediately, but as far as I can tell its functions are not copied over successfully either. This is indeed a bug or limitation of the webconfig.py script: it propagates the fish_prompt function alone, not the entire file from which it came.
For fish 2.0, I'm going to add an ugly hack to move the relevant function definitions inside fish_prompt, so they get copied over. For a future release we should teach webconfig.py how to copy over the file.
Ugly hack to move functions in sample prompts inside fish_prompt to a…
ridiculousfish commentedon May 13, 2013
Ugly hack is 8befc47 . Leaving this open to track fixing it properly.
[-]error with Robbyrussell prompt[/-][+]fish_config only copies fish_prompt function[/+]Fix nim prompt (via web_config)
Fix nim prompt (via web_config)
jhdxr commentedon Jan 26, 2021
8 years passed, I'm wondering if this issue get addressed? Sorin uses
fish_right_promptand it seems still not workingridiculousfish commentedon Jan 30, 2021
This is not fixed properly; however as of b722e9a none of the sample prompts define function outside of
fish_prompt, so it's worked around. That commit will be in 3.2.jhdxr commentedon Jan 31, 2021
@ridiculousfish Thanks. Just curious, is there any special reason that you always prefer these workarounds rather than modifying webconfig.py?
ridiculousfish commentedon Jan 31, 2021
No, it's just easier. Modifying webconfig.py is the right approach but would have to duplicate some work done by
funcsave, like fetching$__fish_config_dirand creating the functions directory. If you or anyone has the appetite for it then we'd love to merge a PR.