-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Bash history integration on Mac prefixing selected command with reverse index #3988
Comments
No idea what's going on. Can you start bash like this, bash --noprofile --rcfile <(fzf --bash) -x press CTRL-R, and post the output? |
I started bash that way but for some reason the FZF keyboard shortcuts were not working. So I dumped the contents of that same command into a file and sourced it, and that resolved it. With this clean bash startup I am not getting the prefix issue anymore. A difference I noticed is that now the indexes presented in the selection list are positive, whereas, as I posted in the OP, when the problem happens they are presented as a negative count from the last history entry. Looking at the diff between the commands shown by The commands executed when hitting
There are 2 differences to he problematic execution.
becomes
and these two lines are not executed at all:
My guess is that the latter bit is the problematic one. It seems this is something specific to my environment, and I'll try to figure it out. Thanks for the help so far! |
For any other Google folks that land here with the same issue on their corp machines: I've narrowed it down to this line in Line 64 in 64c6160
When I run with my default shell setup, print "last_hist: |" . $ENV{last_hist} . "|; HISTCOUNT: |" . $HISTCOUNT . "|; \$.: |" . $. . "|"' Then the output I see when running
Whereas when I run it in a shell started with
I suspect as @chuim says it's something to do with the bash-preexec setup we use, but I didn't get fully to the bottom of it. For now I've settled on a workaround of forcing the Line 57 in 64c6160
Thanks! |
Checklist
man fzf
)Output of
fzf --version
0.55.0 (brew)
OS
Shell
Problem / Steps to reproduce
After coming back from vacation and starting to use my company's MacBook, I noticed that the Bash history integration of FZF started doing this odd thing: when inserting a selected history item into the command line, it is now prefixed with the reverse index of that entry. It didn't use to do that a few weeks ago.
For instance, after pressing
CTRL+R
and selecting the highlighted item below:This is the command line that is inserted:
Whereas the correct/expected command should be:
The text was updated successfully, but these errors were encountered: