Closed ras0q closed 2 years ago
@Ras96 it seems homebrew didn't add the executable to your PATH, or you didn't add homebrew's bin folder to the PATH (export PATH=/opt/homebrew/bin:$PATH
-> double check the actual path)
I have no problem with either.
In my envirinment, fish executes the following commands at startup
# at ~/.config/fish/config.fish
oh-my-posh init fish --config ~/.omp-theme.json | source
Then, brew upgrade
will remove the old version of oh-my-posh and install the new version.
If you installed omp with brew, the output of oh-my-posh init
depends on the version of it, so removing the old version will break its appearance.
Full outputs:
$ oh-my-posh init fish --config ~/.omp-theme.json
set --export POSH_THEME /home/ras/.omp-theme.json
set --global POWERLINE_COMMAND "oh-my-posh"
set --global CONDA_PROMPT_MODIFIER false
set --global omp_tooltip_command ""
set --global omp_transient 0
# template function for context loading
function set_poshcontext
return
end
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"
/home/linuxbrew/.linuxbrew/Cellar/oh-my-posh/12.10.0/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
set_poshcontext
/home/linuxbrew/.linuxbrew/Cellar/oh-my-posh/12.10.0/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 (/home/linuxbrew/.linuxbrew/Cellar/oh-my-posh/12.10.0/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
/home/linuxbrew/.linuxbrew/Cellar/oh-my-posh/12.10.0/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 "false" = "true"
bind \x20 _render_tooltip
end
# transient prompt
function _render_transient
if commandline --paging-mode
commandline --function accept-autosuggestion
return
end
set omp_transient 1
commandline --function repaint
commandline --function execute
end
if test "false" = "true"
bind \r _render_transient
end
# legacy functions
function enable_poshtooltips
return
end
function enable_poshtransientprompt
return
end
I would like the output of oh-my-posh init
to be version-independent.
I resolved it with the -s
flag. Thank you!
oh-my-posh init fish -s --config ~/.omp-theme.json | source
ah, that's because we fetch the actual binary and indeed strict disables that.
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?
I install omp with brew.
After running
brew upgrade
, the following log was output and UI was broken.Theme
jblab_2021
What OS are you seeing the problem on?
Linux
Which shell are you using?
fish
Log output