3260 Commits

Author SHA1 Message Date
Junegunn Choi
81c51c26cc
[man] Describe what 'smart-case' mode is
Close #4256
2025-02-20 08:02:04 +09:00
Junegunn Choi
6fa8295ac5
walker: Append path separator to directories
Close #4255
2025-02-18 22:03:59 +09:00
Junegunn Choi
f975b40236
Fix {q} in preview window affected by 'search' action 2025-02-18 10:08:47 +09:00
Alexei Șerșun
01d9d9c8c8
Normalize char before pattern lookup (#4252)
There is an edge-case in FuzzyMatchV1 during backward scan, related to
normalization: if string is initially denormalized (e.g. Unicode symbol),
backward scan will proceed further to the next char; however, when the
score is computed, the string is normalized first, then scanned based on
the pattern. This leads to accessing pattern index increment, which
itself leads to out-of-bound index access, resulting in a panic.

To illustrate the process, here's the sequence of operations when search
is perfored:

1. during backward scan by "minim" pattern

```
xxxxx Minímal example
      ^^^^^^^^^^^^
      ||||||||||||
      miniiiiiiiim <- compute score for this substring
```
2. during compute score by "minim" pattern
```
      Minímal exam
      minimal exam <- normalize chars before computing the score
      ^^^^^^
      ||||||
      minim <- at this point the pattern is already fully scanned and index
              is out-of-the-bound
```

In this commit the char is normalized during backward scan, to detect
properly the boundaries for the pattern.
2025-02-17 20:50:15 +09:00
Junegunn Choi
1eafc4e5d9
Ignore NULL byte before CSI 6N response
Close #2455
2025-02-16 21:18:01 +09:00
junegunn
38e4020aa8 Deploying to master from @ junegunn/fzf@ac32fbb3b2 🚀 2025-02-16 00:02:15 +00:00
Junegunn Choi
ac32fbb3b2
Avoid printing items in an extremely narrow screen 2025-02-13 22:12:25 +09:00
Junegunn Choi
7d26eca5cc
Truncate wrap sign in the list section if necessary 2025-02-13 21:50:53 +09:00
Junegunn Choi
3347d61591
0.60.0 v0.60.0 2025-02-13 00:54:21 +09:00
Junegunn Choi
9abf2c8c9c
Allow suffix match on --nth with custom --delimiter
When --nth is used with a custom --delimiter, the last delimiter was
included in the search scope, forcing you to write the delimiter in
a suffix-match query. This commit removes the last delimiter from the
search scope.

  # No need to write 'bar,$'
  echo foo,bar,baz | fzf --delimiter , --nth 2 --filter 'bar$'

This can be seen as a breaking change, but I'm gonna say it's a bug fix.

Fix #3983
2025-02-12 20:53:32 +09:00
Junegunn Choi
84e2262ad6
Make --accept-nth and --with-nth support templates 2025-02-12 20:15:04 +09:00
Junegunn Choi
378137d34a
Simplify code 2025-02-11 23:43:43 +09:00
Junegunn Choi
66ca16f836
Truncate wrap signs in extremely narrow preview window 2025-02-11 23:41:54 +09:00
bitraid
282884ad83
[fish] Unescape query from commandline (#4236)
More natural processing of the query taken from command line, by
unquoting/unescaping the token. Unescaped open quotes are removed.
Because of how `string unescape` works, if both single and double quotes
are present, with the outer quotes open, only the outer quotes are
removed.

Examples:
`'foo bar'`, `"foo bar"`, `foo\ bar` becomes `foo bar`
`"foobar`, `'foobar`, `foo"bar`, `foo'bar` becomes `foobar`
`'"foo"'`, `'"foo"` becomes `"foo"`
`"'foo'"`, `"'foo'` becomes `'foo'`
`"'foo` becomes `'foo`
`'"foo` becomes `"foo`
2025-02-11 23:19:40 +09:00
dependabot[bot]
7877ac42f0
Bump golang.org/x/term from 0.28.0 to 0.29.0 (#4234)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.28.0 to 0.29.0.
- [Commits](https://github.com/golang/term/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-11 00:41:55 +09:00
Junegunn Choi
19ef8891e3
Print --wrap-sign in preview window
Close #4233
2025-02-11 00:01:50 +09:00
Coko
bfea9e53a6
fzf-preview.sh: Use kitten icat on ghostty (#4232)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-02-09 20:02:05 +09:00
Junegunn Choi
a2420026ab
Rename actions: exclude and exclude-multi
https://github.com/junegunn/fzf/pull/4231#issuecomment-2646067669
2025-02-09 13:52:20 +09:00
Junegunn Choi
1be1991299
Add exclude-current action
https://github.com/junegunn/fzf/pull/4231#issuecomment-2646063208
2025-02-09 13:37:22 +09:00
Junegunn Choi
67dd7e1923
Add 'exclude' action for excluding current/selected items from the result (#4231)
Close #4185
2025-02-09 13:22:33 +09:00
Junegunn Choi
2b584586ed
Add --accept-nth option to transform the output
This option can be used to replace a sed or awk in the post-processing step.

  ps -ef | fzf --multi --header-lines 1 | awk '{print $2}'
  ps -ef | fzf --multi --header-lines 1 --accept-nth 2

This may not be a very "Unix-y" thing to do, so I've always felt that fzf
shouldn't have such an option, but I've finally changed my mind because:

* fzf can be configured with a custom delimiter that is a fixed string
  or a regular expression.
* In such cases, you'd need to repeat the delimiter again in the
  post-processing step.
* Also, tools like awk or sed may interpret a regular expression
  differently, causing mismatches.

You can still use sed, cut, or awk if you prefer.

Close #3987
Close #1323
2025-02-09 11:53:35 +09:00
Eric Chen
a1994ff0ab
Update README.md (#4225) 2025-02-09 09:19:15 +09:00
junegunn
ca0e858871 Deploying to master from @ junegunn/fzf@06c6615507 🚀 2025-02-09 00:02:24 +00:00
bitraid
06c6615507
[fish] Fix for directories with special characters (#4230)
Using CTRL-T or ALT-C when the current command line token contained a
directory with special characters, the script would fail to detect it.
For exampe, an existing directory named `it\'s\ a\ test`, instead of
using it as walker-root, it would use it as the query.
2025-02-08 22:18:05 +09:00
Junegunn Choi
818d0be436
Fix change-header-label+change-header
Fix #4227
2025-02-07 20:57:09 +09:00
Junegunn Choi
fcd2baa945
Fix scrolling performance when --wrap is enabled
Fix #4221
2025-02-06 22:30:39 +09:00
Junegunn Choi
62e0a2824a
Fix nth highlighting
Fix #4222
2025-02-06 19:57:39 +09:00
Junegunn Choi
bbe1721a18
0.59.0 v0.59.0 2025-02-02 23:39:47 +09:00
Junegunn Choi
c1470a51b8
Update Dockerfile 2025-02-02 23:10:53 +09:00
Junegunn Choi
6ee31d5dc5
Fix failing test case 2025-02-02 17:46:14 +09:00
Junegunn Choi
65d74387e7
Stop processing more actions after a terminal action (accept, abort, etc.) 2025-02-02 16:28:32 +09:00
junegunn
7d0ea599c4 Deploying to master from @ junegunn/fzf@b7795a3dea 🚀 2025-02-02 00:02:12 +00:00
Junegunn Choi
b7795a3dea
Fix RuboCop errors 2025-02-02 02:48:04 +09:00
Junegunn Choi
323f6f6202
Fix mode switching example in CHANGELOG 2025-02-02 02:26:13 +09:00
Junegunn Choi
0c61223884
Fix tcell renderer's pause and resume 2025-02-02 02:23:48 +09:00
Junegunn Choi
32234be7a2
FZF_KEY enhancements
* 'enter' instead of 'ctrl-m'
* 'space' instead of ' '
2025-02-02 02:23:47 +09:00
Junegunn Choi
178b49832e
Fix {show,hide,toggle}-input and add test cases 2025-02-01 17:23:22 +09:00
Junegunn Choi
18cbb4a84d
Display header lines at the top in 'reverse-list' layout 2025-02-01 17:03:59 +09:00
Junegunn Choi
e84afe196a
Add {show,hide,toggle}-input and expose $FZF_INPUT_STATE 2025-02-01 17:03:59 +09:00
Junegunn Choi
e1e171a3c4
Add toggle-bind 2025-02-01 17:03:59 +09:00
Junegunn Choi
d075c00015
Fix --layout reverse-list --no-input 2025-02-01 09:28:02 +09:00
Junegunn Choi
6c0ca4a64a
Add --no-input to hide the input section (#4210)
Close #2890
Close #1396
 
You can't type in queries in this mode, and the only way to trigger an
fzf search is to use `search(...)` action.

  # Click header to trigger search
  fzf --header '[src] [test]' --no-input --layout reverse \
      --header-border bottom --input-border \
      --bind 'click-header:transform-search:echo ${FZF_CLICK_HEADER_WORD:1:-1}'
2025-01-30 00:50:46 +09:00
dependabot[bot]
6b5d461411
Bump crate-ci/typos from 1.28.4 to 1.29.4 (#4161)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.28.4 to 1.29.4.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.28.4...v1.29.4)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 17:11:12 +09:00
Junegunn Choi
7419e0dde1
Update ADVANCED.md 2025-01-29 17:09:22 +09:00
bitraid
cf2bb5e40e
[fish] Improve fish binary path detection (#4208)
Instead of exporting a local `$SHELL` containing the location of fish in
`$PATH` when global `$SHELL` is not fish, always set `--with-shell` with
the actual binary path of fish that the function is running from.
2025-01-28 21:34:21 +09:00
Moritz Dietz
f466e94d65
Fix typos in ADVANCED.md (#4209) 2025-01-28 21:26:52 +09:00
Junegunn Choi
eb0257d48f
Enhance --min-height option to take number followed by + 2025-01-28 18:34:12 +09:00
Junegunn Choi
b83dd6c6b4
Update ADVANCED example using 'search' action 2025-01-28 17:48:46 +09:00
Junegunn Choi
51c207448d
Set the default value of --min-height depending on other options 2025-01-27 20:33:47 +09:00
Junegunn Choi
a6a558da30
Update junegunn/go-shellwords 2025-01-27 19:21:22 +09:00