-
Notifications
You must be signed in to change notification settings - Fork 90
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
s/history/fc #53
s/history/fc #53
Conversation
@rcaloras - ping! |
@jombooth I'm getting the previous command passed to [rcaloras:~/git/bash-preexec] jombooth-fc ± preexec() { echo "about to execute: $1"; }
[rcaloras:~/git/bash-preexec] jombooth-fc ± echo "1"
about to execute: preexec() { echo "about to execute: $1"; }
1
[rcaloras:~/git/bash-preexec] jombooth-fc ± echo "2"
about to execute: echo "1"
2
[rcaloras:~/git/bash-preexec] jombooth-fc ± echo "3"
about to execute: echo "2"
3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the example. Tried against master and it works fine.
Just found time to test this out on my machine; the example seems to work as expected - jo@computer: $ . bash-preexec.sh Can you test this again? |
Was just able to recreate. I'm getting this error specifically on my macbook. Works fine on my linux environment. Maybe something in regards to the bash version?
|
Hmm, I suppose I've only run this on Bash 4. Out of curiosity, what's the output of fc -l -0 on your Mac? On mine I get the current command: jo@computer: $ fc -l -0 |
Looks like it's the previous command. Opening a new terminal window and testing: [rcaloras:~] $ fc -l -0
500 exit
[rcaloras:~] $ fc -l -0
501 fc -l -0 |
Withdrawing this PR as inconsistent "fc" behavior messes it up. Alas... |
Replace 'history' with 'fc', since the latter is designed to be machine-parsable; this way there's no need to adjust HISTTIMEFORMAT.