Open strboul opened 10 months ago
I believe the issue is that the %exit_code
keyword is replaced by the exit code in the _auto_notify_format()
function. It's not recognised by zsh directly.
When you're exporting the AUTO_NOTIFY_BODY
environmental variable, it's evaluating %exit_code
as the string "%exit_code"
, not the value %exit_code
represents later. [[ %exit_code == '0' ]]
will always evaluate as false because of this.
Dynamically changing the message based on exit code isn't currently possible. I've made a pull request that adds an icon you can customise to the notification depending on whether it completes or fails, which would result in similar behaviour to the one you're attempting.
Issue Details
I try to customize the notification body in order to display different emojis based on exit (status) codes. The code I put below always returns the failure one even though the status code is zero. I thought there's a trivial issue with the bash/zsh interpolation but I couldn't resolve it, so I'm wondering if someone has any idea or solution.
Thanks a lot for this nice plugin :raised_hands:
Operating System (uname -a)
zsh version (zsh --version)
auto-notify version (echo "$AUTO_NOTIFY_VERSION")
How is auto-notify installed?