Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle another edge case in $PROMPT_COMMAND. #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JeffFaer
Copy link

@JeffFaer JeffFaer commented Feb 18, 2024

In particular: bash-preexec installs itself by appending __bp_install_string to $PROMPT_COMMAND. That means that there's a pretty good change 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 #153

In particular: bash-preexec installs itself by appending
__bp_install_string to $PROMPT_COMMAND. That means that there's a pretty
good change 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 rcaloras#153
@akinomyoga
Copy link
Contributor

This is a part of #143. In particular, fe5aedb is the commit for colon reduction with other refactoring and also contains the unit tests for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

preexec doesn't work for no-op command :
2 participants