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
Would you explain, please, reason why for zsh shell was chosen magic-space widget for tooltips?
powerlevel10k use zle-line-pre-redraw, and this widget provides better user experience, as I think.
For example, I have tooltip for kubectl:
When I type with powerlevel10k enabled, i'we got such results:
k - tooltip with context and namespace is shown
ku - tooltip disapears
...
kubectl - tooltip appears again.
But in oh-my-posh, I can see tooltip only if will write k<space> or kubectl<space>.
I made some changes in my oh-my-posh initilization script:
134,136c134,138
< if [[ $KEYS != ' ' ]]; then
< return
< fi
---
> local right=$(_omp_get_prompt right)
>
> #if [[ $KEYS != ' ' ]]; then
> # return
> #fi
142c144,151
< if [[ -z $tooltip_command ]] || [[ $tooltip_command = "$_omp_tooltip_command" ]]; then
---
> if [[ -z $tooltip_command ]]; then
> _omp_tooltip_command=""
> RPROMPT=$right
> zle .reset-prompt
> return
> fi
>
> if [[ $tooltip_command = "$_omp_tooltip_command" ]]; then
148a158,159
> RPROMPT=$right
> zle .reset-prompt
152c163
< RPROMPT=$tooltip
---
> RPROMPT=$tooltip$right
220c231,239
< local widget=${$(bindkey ' '):2}
---
> local requested_widget=$1
> case ${widgets[$requested_widget]:-''} in
> '')
> local widget=${$(bindkey ' '):2}
> ;;
> *)
> local widget=$requested_widget
> ;;
> esac
230a250,251
>
> enable_poshtooltips "zle-line-pre-redraw"
With this changes oh-my-posh acts alike as powerlevel10k. And I don't know - is there any pitfals with this code.
Those changes also, make that right part of theme don't dispear when tooltip is shown.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Would you explain, please, reason why for zsh shell was chosen
magic-space
widget for tooltips?powerlevel10k use
zle-line-pre-redraw
, and this widget provides better user experience, as I think.For example, I have tooltip for kubectl:
When I type with powerlevel10k enabled, i'we got such results:
k - tooltip with context and namespace is shown
ku - tooltip disapears
...
kubectl - tooltip appears again.
But in oh-my-posh, I can see tooltip only if will write
k<space>
orkubectl<space>
.I made some changes in my oh-my-posh initilization script:
With this changes oh-my-posh acts alike as powerlevel10k. And I don't know - is there any pitfals with this code.
Those changes also, make that right part of theme don't dispear when tooltip is shown.
Beta Was this translation helpful? Give feedback.
All reactions