On 2026-02-08 16:06, Vincent Bernat wrote:
I think the attached does what you want. It's based on the modify-$BUFFER + .accept-line variation because among other things that has the advantage of working at the PS2 prompt. It unconditionally removes and re-adds quotes. The original $BUFFER is saved in a global variable which is then added to the history by the preexec hook, after suppressing the automatic history with zshaddhistory hook. This could probably use a function instead of an alias for "=", but I didn't change that.Thanks, it works perfectly!
FI, I have written a short blog post about this: https://vincent.bernat.ch/en/blog/2026-zsh-calculator
Thanks again!