Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants