rcaloras / bash-preexec

⚡ preexec and precmd functions for Bash just like Zsh.
MIT License
862 stars 94 forks source link

Run preexec for commented out commands #158

Open yedayak opened 2 months ago

yedayak commented 2 months ago

Currently preexec doesn't run on commented out commands, since they aren't included in $BASH_COMMAND. This means that tools like atuin don't know about them, see here. It will be great if there was a way to run preexec in this case. Perhaps related to https://github.com/rcaloras/bash-preexec/issues/153, https://github.com/rcaloras/bash-preexec/pull/143?

akinomyoga commented 2 months ago

It will be great if there was a way to run preexec in this case.

Once Bash 5.3 comes out, https://github.com/rcaloras/bash-preexec/issues/28#issuecomment-1754935587 should work as far as I understand.

Particularly for the case of Atuin, since the number of variables that Atuin tries to modify in preexec is limited, the combination of subshell and parameter expansion, e.g. PS0=${ATUIN_HISTORY_ID:=$(...)} might also work in Bash 4.4+.

Perhaps related to #153, #143?

They are different issues.