-
-
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
Feature request: drop dependency for Perl in key-bindings.bash
#3077
Comments
While awk is POSIX, perl isn't pre-installed on all *nix flavors. This commit replaces perl with awk thus it eliminates the perl dependency. This commit passed the current test suite with zero errors : * `make error` => all test sections 'ok' * `make docker-test` => Finished in 50.929904s, 4.1822 runs/s, 35.3427 assertions/s. 213 runs, 1800 assertions, 0 failures, 0 errors, 0 skips See also: junegunn#2777 junegunn#1934 # junegunn#3077 junegunn#2260 Note: unlike the original perl script, which gets `$HISTCOUNT` from the environment, the awk script reads the initial history count from line 1 of stdin. Then follow the history list, and finally a `\t`. The reason for `\t` is to fix a small, pre-existing issue I noticed while developing this patch (see the PR associated with this commit for additional information).
this doesn't seem like big deal to rewrite in awk or so. EDIT: the PR is already there: #3295 |
Looks like the latest effort is stuck on performance issues: #3313 (comment). I added a suggestion there. |
Right, I'm suggesting implementing the filter in golang behind some hidden switch. But I'm not a maintainer :) I would try to get @junegunn's opinion on it before doing this. |
can be closed due to #3313 merge |
It seems like perl is still the default option and awk is only a fallback.
(I have perl but my perl environment is a little bit broken (complains about locale settings), I will modify my local |
TLDR; #3313 (comment) |
@kaddkaka broken about locale, add |
Thanks.I'm not confident to do a PR because I don't understand why that would work. |
you can test that with your environment it no longer prints locale init errors: perl -e 1 LC_ALL=C perl -e 1 perl would need locales as some code depends on locale data. regexes? but the current script doesn't seem to contain something that would need locales, so it seems safe :) |
man fzf
)Info
Problem / Steps to reproduce
__fzf_history__()
inkey-bindings.bash
requires Perl. In more minimal environments, Perl may not be installed. It would be nice to be able to drop that dependency. Looking at the exact code there, it seems like it's just doing some frequency counting of the bash command history. Could we have that be built into fzf perhaps and gated behind a flag?The text was updated successfully, but these errors were encountered: