m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-08 11:23:47 -05:00
Commit Graph

3295 Commits

Author SHA1 Message Date
Junegunn Choi
575bc0768c Update .goreleaser to build android_arm64 binary (#4428) 2025-06-19 22:57:16 +09:00
Junegunn Choi
89334e881e Update man page and changelog 2025-06-19 22:56:41 +09:00
Junegunn Choi
dcec6354f5 Add {*} placeholder flag 2025-06-19 22:35:23 +09:00
Junegunn Choi
16d338da84 Revert "Add {*} placeholder flag"
This reverts commit 27258f7207.
2025-06-19 12:39:31 +09:00
Junegunn Choi
27258f7207 Add {*} placeholder flag 2025-06-19 01:04:59 +09:00
曹家巧
4d2d6a5ced chore: fix function name (#4425)
Signed-off-by: xiaoxiangirl <caojiaqiao@outlook.com>
2025-06-19 00:47:14 +09:00
Junegunn Choi
0c00b203e6 Implement asynchronous transform actions (#4419)
Close #4418

Example:

    fzf --bind 'focus:bg-transform-header(sleep 2; date; echo {})'
2025-06-16 00:39:11 +09:00
Junegunn Choi
3b68dcdd81 Add footer
Options:
  --footer=STR             String to print as footer
  --footer-border[=STYLE]  Draw border around the footer section
                           [rounded|sharp|bold|block|thinblock|double|horizontal|vertical|
                            top|bottom|left|right|line|none] (default: line)
  --footer-label=LABEL     Label to print on the footer border
  --footer-label-pos=COL   Position of the footer label
                           [POSITIVE_INTEGER: columns from left|
                            NEGATIVE_INTEGER: columns from right][:bottom]
                           (default: 0 or center)

The default border type for footer is 'line', which draws a single
separator between the footer and the list. It changes its position
depending on `--layout`, so you don't have to manually switch between
'top' and 'bottom'

The 'line' style is now supported by other border types as well.
`--list-border` is the only exception.
2025-06-10 23:02:23 +09:00
Junegunn Choi
39db026161 Fix inconsistent placement of header-lines with border options
fzf displayed --header-lines inconsistently depending on the presence of borders:

  # --header and --header-lines co-located
  seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first

  # --header and --header-lines separated
  seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first --header-lines-border

This commit fixes the inconsistency with the following logic:

* If only one of --header or --header-lines is provided, --header-first
  applies to that single header.
* If both are present, --header-first affects only the regular --header,
  not --header-lines.
2025-06-10 23:02:23 +09:00
Koichi Murase
f6c589c606 [bash,zsh] Skip comments in ~/.ssh/config
For the line "Host host1 # this is a comment", the current
implementation generates words in an inline comment as hostnames.
This patch removes the comment before generating the hostname.
2025-06-09 21:46:53 +09:00
Koichi Murase
2bd29c3172 [bash,zsh] Support "=" after "Hostname" and "Host" in ~/.ssh/config
In ~/.ssh/config, "=" can also be used as a separator between the
field name and the value.  The current master does not properly handle
this and generate a hostname "=" or one starting with "=".  This patch
correctly handles it.
2025-06-09 21:46:53 +09:00
Koichi Murase
4a61f53b85 [bash,zsh] Remove redundant filtering-out of comment/blank lines
Comments are anyway removed in the subsequent call to `sub(/#.*/,
"")`, and it becomes a blank line.  Blank lines do not have fields, so
they are ignored in the next for-loop.
2025-06-09 21:46:53 +09:00
Koichi Murase
adc9ad28da [bash,zsh] Correctly exclude the hostname "0.0.0.0"
In the current implementation, any hostnames in /etc/hosts containing
"0.0.0.0" as a part (such as "110.0.0.0" would be excluded.  "0.0.0.0"
should be checked by the exact match.
2025-06-09 21:46:53 +09:00
Koichi Murase
585cfaef8b [bash,zsh] Do not end the hostname analysis on "]" in ~/.ssh/known_hosts
An entry of the form `[example.com]:port,192.168.0.1 ...` in
~/.ssh/known_hosts are not properly processed.  The current
implementation gives up the matching on the first occurrence of `]`,
the subsequent 192.168.0.1 would not be extracted.  This patch
continues the analysis and removes "]" together with "[".

This patch also removes the ":port" part from the hostnames in
~/.ssh/known_hosts.  One cannot use the form "hostname:port" in the
arguments to the ssh command anyway.
2025-06-09 21:46:53 +09:00
Koichi Murase
b5cd8880b1 [bash,zsh] Process hostnames with uppercase letters in known_hosts 2025-06-09 21:46:53 +09:00
junegunn
44ddab881e Deploying to master from @ junegunn/fzf@bfa287b66d 🚀 2025-06-08 00:02:27 +00:00
Koichi Murase
bfa287b66d [bash,zsh] Separate common functions into "shell/common.sh" 2025-06-08 00:00:17 +09:00
Koichi Murase
243e52fa11 [bash,zsh] Work around mawk 1.3.3-20090705 not supporting the POSIX brackets 2025-06-08 00:00:17 +09:00
Koichi Murase
c166eaba6d [bash,zsh] Work around Solaris awk, which is non-standard
Solaris awk at /usr/bin/awk is meant for backward compatibility with
an ancient implementation of 1977 awk in the original UNIX.  It lacks
many features of POSIX awk.  To use a standard-conforming version in
Solaris, one needs to explicitly use /usr/xpg4/bin/awk.
2025-06-08 00:00:17 +09:00
Koichi Murase
09194c24f2 [bash,zsh] Work around a quirk of macOS awk
macOS awk is a variant of nawk, but it contains a unique patch for the
UTF-8 support.  However, this patch causes the problem.  If the input
contains any non-UTF-8 data, macOS awk stops processing and does not
do anything, instead of ignoring the unrecognized data and continue
the processing.  However, the contents of the ssh configuration and
/etc/hosts is not under the control of fzf, so we cannot fix the input
when those files contain non-UTF-8 data.  To work around this
behavior, one can set the locale to LC_ALL=C to treat the input data
with the plain 8-bit encoding.
2025-06-08 00:00:17 +09:00
Koichi Murase
ec521e47aa [bash,zsh] Reduce the number of fork & exec 2025-06-05 13:02:11 +09:00
Koichi Murase
e3f4a51c18 [zsh] Set shell options for pathname expansion "~/.ssh/config.d/*"
This applies the same changes as commit 0a06fd6f for Bash (GitHub PR
2025-06-05 13:02:11 +09:00
Koichi Murase
0a06fd6f63 [bash] Set shell options for pathname expansion "~/.ssh/config.d/*" (#4405) 2025-06-03 20:47:28 +09:00
Koichi Murase
70eace5290 Fix the CI failure for PR caused by a spelling mistake (#4406) 2025-06-03 19:41:47 +09:00
junegunn
40f9f254a9 Deploying to master from @ junegunn/fzf@15d6c17390 🚀 2025-06-01 00:02:34 +00:00
Junegunn Choi
15d6c17390 Fix ANSI attributes lost when nth:regular is set
Example:
  # foo was not displayed in italic
  echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color fg:dim,nth:regular --nth 1
2025-05-30 21:02:35 +09:00
Junegunn Choi
a9d1d42436 Fix ANSI attributes lost when 'regular' attribute is set to fg or nth
Examples:

  echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color fg:regular
  echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color nth:regular
2025-05-30 20:43:20 +09:00
Junegunn Choi
1ecfa38eee [bash] Fix 'complete' errors when IFS is newline
Fix #4342
2025-05-30 20:41:50 +09:00
Junegunn Choi
54fd92b7dd --no-color: Keep ANSI attributes in the list
Example:
  echo -e "\x1b[33;3mfoo \x1b[34;4mbar\x1b[m baz" | fzf --ansi --no-color
2025-05-30 20:33:21 +09:00
Junegunn Choi
835906d392 --no-color: Keep ANSI attributes in preview window
Example:
  fzf --preview 'echo -e "\x1b[33;3mfoo \x1b[34;4mbar\x1b[m baz"' --no-color
2025-05-30 20:26:53 +09:00
Junegunn Choi
1721e6a1ed Do not apply 'nth' attributes to trailing whitespaces
# foo  bar
    # -----    <- previously underlined trailing whitespace
    # ---      <- with the fix, trailing whitespace is excluded
    fzf --color nth:underline --nth 1 <<< 'foo  bar'
2025-05-30 19:43:10 +09:00
Junegunn Choi
c7ee3b833f Fix FZF_CLICK_HEADER_NTH for multi-line headers 2025-05-30 17:10:26 +09:00
Junegunn Choi
ffb6e28ca7 Allow customizing --ghost color via '--color ghost'
Examples:

  # Dimmed red
  fzf --ghost booya --color ghost:red

  # Regular red
  fzf --ghost booya --color ghost:red:regular

Close #4398
2025-05-28 00:27:33 +09:00
Junegunn Choi
a4c6846851 Fix background color of 'disabled' query
fzf --color disabled:red,list-bg:blue --disabled --query foo --input-border
2025-05-28 00:17:41 +09:00
Junegunn Choi
d18c0bf694 [man] Add GET endpoint example 2025-05-22 21:57:04 +09:00
Junegunn Choi
4e3f9854e6 Update README.md 2025-05-17 22:06:06 +09:00
Junegunn Choi
b27943423e Show ellipsis for truncated labels
Close #4390
2025-05-17 11:25:15 +09:00
Junegunn Choi
894a1016bc RuboCop lint 2025-05-17 11:20:29 +09:00
Junegunn Choi
efe6cddd34 Update README 2025-05-16 22:15:38 +09:00
Junegunn Choi
f1c6bdf3e8 Update README 2025-05-16 22:15:06 +09:00
Junegunn Choi
710659bcf5 Update SECURITY.md 2025-05-14 11:06:15 +09:00
Josef Andersson
be67775da4 Add initial security policy (#4379)
Signed-off-by: Josef Andersson <janderssonse@proton.me>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-05-14 11:05:20 +09:00
jiz4oh
2c6381499c [neovim] Respect winborder of Neovim 0.11+ (#4389)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-05-14 00:53:26 +09:00
junegunn
4df842e78c Deploying to master from @ junegunn/fzf@b81696fb64 🚀 2025-05-11 00:02:09 +00:00
Ajeet D'Souza
b81696fb64 bash: set keybinding right before printing special character (#4377) 2025-05-10 15:29:27 +09:00
Junegunn Choi
d226d841a1 0.62.0 v0.62.0 2025-05-04 18:31:18 +09:00
Junegunn Choi
c6d83047e5 Allow whitespace as separator in --color option 2025-05-04 15:08:23 +09:00
Junegunn Choi
46dabccdf1 [vim] Update g:fzf_colors example with 'query' 2025-05-04 14:52:22 +09:00
Junegunn Choi
cd9517b679 Add 'alt-bg' color for striped lines (#4370)
Test cases:

1. 'jump' should show alternating background colors even when 'alt-bg' is
not defined as before.

  go run main.go --bind load:jump

Two differences:
  * The alternating lines will not be in bold (was a bug)
  * The marker column will not be rendered with alternating background color

2. Use alternating background color when 'alt-bg' is set

  go run main.go --color bg:238,alt-bg:237
  go run main.go --color bg:238,alt-bg:237 --highlight-line

3. 'selected-bg' should take precedence

  go run main.go --color bg:238,alt-bg:237,selected-bg:232 \
                 --highlight-line --multi --bind 'load:select+up+select+up'

4. Should work with text with ANSI colors

  declare -f | perl -0777 -pe 's/^}\n/}\0/gm' |
    bat --plain --language bash --color always |
    go run main.go --read0 --ansi --reverse --multi \
                   --color bg:237,alt-bg:238,current-bg:236 --highlight-line

---

Close #4354
Fix #4372
2025-05-04 14:32:06 +09:00
junegunn
cd6677ba1d Deploying to master from @ junegunn/fzf@9c1a47acf7 🚀 2025-05-04 00:02:25 +00:00