bash-preexec icon indicating copy to clipboard operation
bash-preexec copied to clipboard

Handle another edge case in $PROMPT_COMMAND.

Open JeffFaer opened this issue 1 year ago • 1 comments

In particular: bash-preexec installs itself by appending __bp_install_string to $PROMPT_COMMAND. That means that there's a pretty good chance that __bp_install_string will be the last thing in $PROMPT_COMMAND when __bp_install is invoked.

If that happens, the $existing_prompt_command logic in __bp_install will result in the pre-existing prompt command followed by : and no trailing newline. That situation is not cleaned up by the two existing special cases.

Fix https://github.com/rcaloras/bash-preexec/issues/153

JeffFaer avatar Feb 18 '24 01:02 JeffFaer

This is a part of #143. In particular, https://github.com/rcaloras/bash-preexec/pull/143/commits/fe5aedb3368d78fc47e017ceffca1d8265cdef0d is the commit for colon reduction with other refactoring and also contains the unit tests for that.

akinomyoga avatar Feb 18 '24 02:02 akinomyoga