Replies: 3 comments 1 reply
-
You could rebind RET using Bash's standard way as Technically there is another way to achieve that by enabling |
Beta Was this translation helpful? Give feedback.
-
Years ago, I came up with https://github.com/d630/bpx when I was working with bash-preexec. It's outdated and has never been reviewed, but it can potentially help in one way or another here |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback @akinomyoga and @d630 ! I'll have a look at bpx! Also, for the reference, I found I had earlier done something which seems like what you describe in the end, @akinomyoga , with the following hack (where #!/bin/bash
function scish() {
export PS1="\033[32mscish > \033[39m"
shopt -s extdebug
trap 'if [[ ! $BASH_COMMAND == ls* && ! $BASH_COMMAND == cd* && ! $BASH_COMMAND == pwd* && ! $BASH_COMMAND == compopt* ]]; then scicmd -c "$BASH_COMMAND"; false; fi' DEBUG
} I hear what you say about potentially other unwanted consequences for the execution though, which I totally don't fully understand. |
Beta Was this translation helpful? Give feedback.
-
I want to capture the command and run it through my own software, and so avoid bash running the command at all, since that would mean it runs twice (once through my own software and then by bash).
What is the recommended way to do this with bash preexec?
Beta Was this translation helpful? Give feedback.
All reactions