-
Notifications
You must be signed in to change notification settings - Fork 93
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
preexec doesn't work for no-op command :
#153
Comments
JeffFaer
added a commit
to JeffFaer/bash-preexec
that referenced
this issue
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. So there's a pretty good change that 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
JeffFaer
added a commit
to JeffFaer/bash-preexec
that referenced
this issue
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 rcaloras#153
JeffFaer
added a commit
to JeffFaer/bash-preexec
that referenced
this issue
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 rcaloras#153
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This might fall into this kind of a situation, and I apologize in advance: https://xkcd.com/1172/
I have a habit of running
:
specifically to execute preexecs. Today, I updated my version of bash-preexec, and that functionality no longer works.bash-preexec/bash-preexec.sh
Lines 330 to 336 in 1f77dc0
When bash-preexec installs itself it replaces its install command with a no-op command
:
. It does not always manage to remove that no-op from the prompt commandbash-preexec/bash-preexec.sh
Lines 245 to 250 in 1f77dc0
bash-preexec does not execute preexec commands if it looks like it's executing something from the
$PROMPT_COMMAND
I think it should be as simple as adding another prune attempt when we're processing
existing_prompt_command
. I'll put something togetherThe text was updated successfully, but these errors were encountered: