powerlevel10k
powerlevel10k copied to clipboard
Reverse search blank lines
I have been having issues with reverse search. I am using oh-my-zsh along with powerlevel10k. When ever I try to perform reverse search on terminal, the results seem to bug out.
What happens if you disable powerlevel10k or replace it with a different theme?
Upon commenting out ~/powerlevel10k/powerlevel10k.zsh-theme from my .zshrc this is the behaviour of the reverse search.
That's interesting. I've no idea what might be the problem.
Do you have marlonrichert/zsh-autocomplete installed by any chance? I have the same problem when there are terraform commands in my history. Used to happen with gcloud as well, until I made that part of the prompt permanent. I think it's something to do with redrawing the prompt when there are elements in the prompt that are only visible when typing certain commands. Look for *_SHOW_ON_COMMAND in your .p10k.zsh for the commands that I think are affected. A simple workaround is to disable the offending *_SHOW_ON_COMMAND, but then the tf workspace element of the prompt will always be visible, even when not running a terraform command.
A more complicated fix seems possible, but I haven't been able to get it to work yet. ChatGPT has pointed me to the _p9k_widget_zle-line-init and _p9k_widget_zle-keymap-select, trying to disable them when the shell is in the history-menu-widget context. Code is ChatGPTs and I haven't found the magical edits to actually make it work. Perhaps one of the incredible zsh wizards around here might have some pointers?
## Save originals
functions[_p9k_widget_zle-line-init-orig]="${functions[_p9k_widget_zle-line-init]}"
functions[_p9k_widget_zle-keymap-select-orig]="${functions[_p9k_widget_zle-keymap-select]}"
## Wrap them and rebind…
function _p9k_widget_zle-line-init() {
[[ "$LASTWIDGET" == "history-search-backward" ]] && return
_p9k_widget_zle-line-init-orig "$@"
}
function _p9k_widget_zle-keymap-select() {
[[ "$LASTWIDGET" == "history-search-backward" ]] && return
_p9k_widget_zle-keymap-select-orig "$@"
}
zle -N zle-line-init _p9k_widget_zle-line-init
zle -N zle-keymap-select _p9k_widget_zle-keymap-select
I can confirm the same issue with p10k + marlonrichert/zsh-autocomplete. I do use kubecontext. Let me know if there is anything I could try