[Enhancement] Adds option to periodically update time segment#1193
[Enhancement] Adds option to periodically update time segment#1193Syphdias wants to merge 2 commits into
Conversation
|
@romkatv wtf? How did you comment before I even created the PR... Edit: You commented on the commit, not the PR, I see... 🤦♂️ |
Interesting. So does it mean
None.
Ha-ha, this is funny. I mailed https://www.zsh.org/mla/workers//2019/msg00161.html. ZSH seems kinda buggy. This is the 4th bug I've bumped into and I haven't been using ZSH even for a month.
Is this related? I'd say this code is fine in |
Good catch! Interestingly I did run into trouble with background jobs but did not notice at the time.
😆
Actually, this is straight from my __p9k_renew-prompt-accept-line() {
zle .reset-prompt
zle accept-line
}
zle -N __p9k_renew-prompt-accept-line
bindkey "^M" __p9k_renew-prompt-accept-line
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=__p9k_renew-prompt-accept-lineSo I'm not asking for overriding the function but overriding the keybind. |
I don't quite get what you are playing at. If I'd change a bindkey setting twice it will simply be overridden there is no conflict or logical problem besides the fact that you might not want to to be overridden. |
|
I'm not sure where the example with key binding is coming from. My comment was abut TMOUT. The user isn't explicitly asking TMOUT to be hogged, they just want thge clock to tick. Many plugins would like to claim TMOUT for themselves to implemented this and that but it's not cool because there is only one TMOUT. Likewise with zle overrides. The user isn't asking for zle-keymap-select to be overridden, they just want vi mode in their prompt. If you claim zle-keymap-select to implement vi_mode segment, then the user cannot use any other plugin that also wants to hook into zle-keymap-select. This is a minor point. I suggest we drop this subject to save time for something more important. |
Agreed. We are arguing about different things. I still like the feature, but since it is a bit hacky and buggy, I'd like to have another option. I'll implement |
This implements #1190
Hey @romkatv,
porting your code was easy. Thank you! I do have some questions though.
next. Please correct my if you think I'm wrong.PROMPTgets evaluated every time you redraw the prompt. OnmasterPROMPTis something like%f%b%k$(__p9k_build_left_prompt), onnextit is__p9k_unsafe_PROMPT. This variable get filled in the precmd hook which is not called onprompt-reset. This was done to fix [Bugfix] Attempt to fix broken ctrl-c behavior #1119 another problem but come is very handy.The issues are with going through the history and tab completion/suggestions. Example for weirdness:
This is how it should look:
This is what happens:
I even had a segfault once doing this.I can reproduce the segfault byls <tab><arrow-keys-especially-up>You mentioned that
zle-keymap-selectwas a rude practice in [Feature request] An option to turntimesegment into realtime clock #1190(?) Would you say the same about an option that would do this?