junegunn / junegunn/fzf

Bash history integration on Mac prefixing selected command with reverse index

Open
#3,988 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

### Checklist

- [X] I have read through the manual page (`man fzf`)
- [X] I have searched through the existing issues
- [X] For bug reports, I have checked if the bug is reproducible in the latest version of fzf

### Output of `fzf --version`

0.55.0 (brew)

### OS

- [ ] Linux
- [X] macOS
- [ ] Windows
- [ ] Etc.

### Shell

- [X] bash
- [ ] zsh
- [ ] fish

### 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:
```
$ `__fzf_history__`
-10 cat .bashrc
-9 ps -p $$
-8 echo $SHELL
-7 exit
-6 -4 brew update && brew upgrade && brew cleanup
-5 brew update && brew upgrade && brew cleanup
-4 cat .profile
▌ -3 ll /opt/homebrew/opt/
-2 vi .profile
-1 history --help
0 history | less
379/379 +S ─────────────────────────────────────────────────────────
>
```

This is the command line that is inserted:
```
$ -3 ll /opt/homebrew/opt/
```

Whereas the correct/expected command should be:
```
$ ll /opt/homebrew/opt/
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.