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

[fish] Enable multiple history commands insertion #4280

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

bitraid
Copy link
Contributor

@bitraid bitraid commented Feb 24, 2025

I recently realized that the become action leaves behind temporary files, so I made some modifications to overcome this. While doing so, I thought it would be a good idea to allow inserting multiple commands when --multi is set. If for some reason you don't like this, I can remove this functionality and just adjust the code to not use become. If on the other hand you think that it should be enabled by default, I can make this change, too. Tested to work with the oldest supported fish version.

@junegunn
Copy link
Owner

junegunn commented Feb 24, 2025

allow inserting multiple commands when --multi is set.

Thanks, I think this is very nice. I didn't do it in other shells, only because it was difficult to get it right.

@junegunn
Copy link
Owner

I recently realized that the become action leaves behind temporary files

Could you clarify which temporary files you mean? I wonder if it's a bug of fzf.

@bitraid
Copy link
Contributor Author

bitraid commented Feb 24, 2025

I recently realized that the become action leaves behind temporary files

Could you clarify which temporary files you mean? I wonder if it's a bug of fzf.

The /tmp/fzf-{temp,proxy)-* files. I also thought that it might be bug of fzf, but after looking briefly at the code, I saw the comment below and figured that it's probably not, so I didn't look more into it:

fzf/src/terminal.go

Lines 4919 to 4922 in e4489dc

case actBecome:
valid, list := t.buildPlusList(a.a, false)
if valid {
// We do not remove temp files in this case

Enable inserting multiple history commands. To disable, set `--no-multi`
through `$FZF_CTRL_R_OPTS`.

Also, remove the usage of `become` action, to avoid leaving behind
temporary files.
@junegunn junegunn merged commit bb64d84 into junegunn:master Feb 25, 2025
5 checks passed
@junegunn
Copy link
Owner

Thanks! Merged with a test case.

@bitraid bitraid deleted the fish-multi-hist branch February 25, 2025 15:35
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 4, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [junegunn/fzf](https://github.com/junegunn/fzf) | patch | `v0.60.2` -> `v0.60.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>junegunn/fzf (junegunn/fzf)</summary>

### [`v0.60.3`](https://github.com/junegunn/fzf/releases/tag/v0.60.3): 0.60.3

[Compare Source](junegunn/fzf@v0.60.2...v0.60.3)

-   Bug fixes and improvements
    -   \[fish] Enable multiple history commands insertion ([#&#8203;4280](junegunn/fzf#4280)) ([@&#8203;bitraid](https://github.com/bitraid))
    -   \[walker] Append '/' to directory entries on MSYS2 ([#&#8203;4281](junegunn/fzf#4281))
    -   Trim trailing whitespaces after processing ANSI sequences ([#&#8203;4282](junegunn/fzf#4282))
    -   Remove temp files before `become` when using `--tmux` option ([#&#8203;4283](junegunn/fzf#4283))
    -   Fix condition for using item numlines cache ([#&#8203;4285](junegunn/fzf#4285)) ([@&#8203;alex-huff](https://github.com/alex-huff))
    -   Make `--accept-nth` compatible with `--select-1` ([#&#8203;4287](junegunn/fzf#4287))
    -   Increase the query length limit from 300 to 1000 ([#&#8203;4292](junegunn/fzf#4292))
    -   \[windows] Prevent fzf from consuming user input while paused ([#&#8203;4260](junegunn/fzf#4260))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xODUuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE4NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants