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

preexec is called / not called in weird moments #104

Open
mkielar opened this issue Feb 7, 2020 · 5 comments
Open

preexec is called / not called in weird moments #104

mkielar opened this issue Feb 7, 2020 · 5 comments

Comments

@mkielar
Copy link

mkielar commented Feb 7, 2020

I have single preexec and precmd functions defined.

preexec() { 
    echo "preexec for $@"
}
precmd() {
    echo "precmd for $@"
}

When I open new bash window, I get this:

precmd for
preexec for <last command from history>
14:08 ● /home/mkielar
→ ls
file1 file2
precmd for

14:09 ● /home/mkielar
→ ls
preexec for ls
file1 file2
precmd for

14:09 ● /home/mkielar
→ ls

So, it is called when I open new bash session, it;s not being called for first command in that bash session, and then it's being called again for any subsequent commands....

@sullivan-sean
Copy link

Has anyone found a solution for this? I'm also running into this issue running bash 5.1.8(1)-release and bash-preexec v0.4.1

@rcaloras
Copy link
Owner

@sullivan-sean same exactly as described here? And bash-preexec.sh is the last thing included in your bash configuration?

@slash-dev
Copy link

slash-dev commented Feb 6, 2023

Please ignore, this was a clash with another tool. Now working as intended. Sorry!

I also have a similar problem. preexec is called when I open the terminal then it's never called again. It used to but since few months it's not working anymore.

@rcaloras
Copy link
Owner

rcaloras commented Feb 6, 2023

@slash-dev could you share what your debug trap and PROMPT_COMMAND look like: e.g. running on my local machine

[rcaloras:~] 3s $ trap && echo "$PROMPT_COMMAND"
trap -- '__bp_preexec_invoke_exec "$_"' DEBUG
__bp_precmd_invoke_cmd
__lp_set_prompt
__bp_interactive_mode

@slash-dev
Copy link

slash-dev commented Feb 7, 2023

Please ignore, this was a clash with another tool. Now working as intended. Sorry!

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

No branches or pull requests

4 participants