Closed ehawman closed 2 years ago
@lewis-yeung seems based on your latest changes?
@ehawman are you on the latest fish shell?
@ehawman It works fine with fish v3.5.1 on my end. What's your fish version?
@JanDeDobbeleer @lewis-yeung Ah the latest version on apt is 3.1.2-3. I'll try manually installing it from source.
I should note that the docs currently advise using the latest version, but cite 3.1.2 specifically. Might want to update that per these changes.
My little RPi2 is chuggin, chuggin, chuggin... 🚂
I have considered using the (...)
form instead, but fish will ignore an empty string argument expanded from it. E.g., either test -z (string match 'a' 'b')
or test -n (string match 'a' 'b')
returns a successful status. 😅
EDITED: A clumsy workaround is using echo
: test -z (echo (string match 'a' 'b'))
. @JanDeDobbeleer @ehawman Do you have a better idea on how to refactor this logic?
@lewis-yeung if @ehawman can confirm the latest version is compatible, we can add the version requirement. If not, I guess I'd rather revert this for fish than to include a hack?
@JanDeDobbeleer We don't have to revert. The latest version is compatible. It's described in the docs of fish:
A command substitution can have a dollar sign before the opening parenthesis like
outercommand $(innercommand)
. This variant is also allowed inside double quotes. When using double quotes, the command output is not split up by lines.
@lewis-yeung let's add that to the docs in this case and have a standard response ready for the inflow of issues 😁
🚂 ☁️ ☁️ ☁️ ☁️
I think I canpile, I think I canpile
87% y'all. I haven't forgotten you 😄
Fish supports $(...)
and "$(...)"
since v3.4.0, as described in its changelog.
Ok (finally) confirming that 3.5.1 works just fine. :)
Apologies for the confusion, fellas. If it didn't take me an hour I'd build 3.4.0 for y'all too.
Yeah just update the docs and I think you're good. I'd have immediately jumped to that conclusion myself, but I saw 3.1.2 and assumed I was good.
let's add that to the docs in this case and have a standard response ready for the inflow of issues 😁
@JanDeDobbeleer See #2699.
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
Had OMP installed on an RPI. Config got borked so I wiped it. Now Fish is crying that oh-my-posh init fish doesn't conform.
Installed via
I'm very confused since this was working before. Also Bash can run it just fine.
Output of oh-my-posh init fish
``` set --export POSH_THEME /home/abcdefg/.cache/oh-my-posh/config.omp.json set --global POWERLINE_COMMAND "oh-my-posh" set --global CONDA_PROMPT_MODIFIER false set --global omp_tooltip_command "" set --global omp_transient 0 function fish_prompt set --local omp_status_cache_temp $status # clear from cursor to end of screen as # commandline --function repaint does not do this # see https://github.com/fish-shell/fish-shell/issues/8418 printf \e\[0J if test "$omp_transient" = "1" /usr/local/bin/oh-my-posh print transient --config $POSH_THEME --shell fish --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count --shell-version $FISH_VERSION return end set --global omp_status_cache $omp_status_cache_temp set --global omp_stack_count (count $dirstack) set --global omp_duration "$CMD_DURATION$cmd_duration" # check if variable set, < 3.2 case if set --query omp_lastcommand; and test "$omp_lastcommand" = "" set omp_duration 0 end # works with fish >=3.2 if set --query omp_last_status_generation; and test "$omp_last_status_generation" = "$status_generation" set omp_duration 0 end if set --query status_generation set --global --export omp_last_status_generation $status_generation end /usr/local/bin/oh-my-posh print primary --config $POSH_THEME --shell fish --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count --shell-version $FISH_VERSION end function fish_right_prompt if test "$omp_transient" = "1" echo -n "" set omp_transient 0 return end if test -n "$omp_tooltip_command" set omp_tooltip_prompt (/usr/local/bin/oh-my-posh print tooltip --config $POSH_THEME --shell fish --error $omp_status_cache --shell-version $FISH_VERSION --command $omp_tooltip_command) if test -n "$omp_tooltip_prompt" echo -n $omp_tooltip_prompt set omp_tooltip_command "" return end end /usr/local/bin/oh-my-posh print right --config $POSH_THEME --shell fish --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count --shell-version $FISH_VERSION end function postexec_omp --on-event fish_postexec # works with fish <3.2 # pre and postexec not fired for empty command in fish >=3.2 set --global --export omp_lastcommand $argv end # perform cleanup so a new initialization in current session works if test "$(string match -e '_render_transient' $(bind \r --user 2>/dev/null))" != '' bind -e \r end if test "$(string match -e '_render_tooltip' $(bind \x20 --user 2>/dev/null))" != '' bind -e \x20 end # tooltip function _render_tooltip commandline --function expand-abbr set omp_tooltip_command (commandline --current-buffer | string collect) commandline --insert " " commandline --function repaint end if test "true" = "true" bind \x20 _render_tooltip end # transient prompt function _render_transient set omp_transient 1 commandline --function repaint commandline --function execute end if test "true" = "true" bind \r _render_transient end # legacy functions function enable_poshtooltips end function enable_poshtransientprompt end ```Theme
oh-my-posh init fish | source
What OS are you seeing the problem on?
Linux
Which shell are you using?
fish
Log output