Junegunn Choi
587df594b8
Fix incompatibility of adaptive height and 'start:reload'
...
This command would cause a deadlock and make fzf crash:
fzf --bind 'start:reload:ls' --height ~100%
Because,
1. 'start' event is handled by Terminal
2. When 'reload' is bound to 'start', fzf avoids starting the initial reader
3. Terminal waits for the initial input to find the right height when
adaptive height is used
4. Because the initial reader is not started, Terminal never gets the
initial list
5. No chance to trigger 'start:reload', hence deadlock
This commit fixes the above problem by extracting the reload command
bound to 'start' event and starting the initial reader with that command
instead of letting Terminal start it.
This commit also makes the environment variables available to
$FZF_DEFAULT_COMMAND.
FZF_DEFAULT_COMMAND='echo $FZF_QUERY' fzf --query foo
Fix #3944
2024-07-27 11:30:25 +09:00
Junegunn Choi
559fb7ee45
Revert "Prefer LightRenderer over tcell on Windows"
...
This reverts commit dca2262fe6 .
> For mouse support on mintty
> Fix #3847
The current implementation LightRenderer for Windows is unable to accept
non-ASCII input unlike the tcell renderer. So even though it supports
mouse on mintty, we shouldn't use it as the default.
* #3799
* #3847
2024-07-26 01:43:21 +09:00
Junegunn Choi
4cc5609d8b
Fix invalid highlighting of truncated multi-line items
2024-07-21 01:09:39 +09:00
Junegunn Choi
3b2e932c13
Bind CTRL-/ and ALT-/ to toggle-wrap by default
2024-07-08 22:51:47 +09:00
Junegunn Choi
035b0be29f
Adjust offset immediately after 'first', 'last', and 'pos'
...
seq 100 | fzf --multi --sync --bind 'result:last+transform:for _ in $(seq 10); do echo -n "+select+down"; done'
2024-07-03 22:06:17 +09:00
Junegunn Choi
cfc149e994
Avoid printing ANSI reset codes
...
fzf --border --bind 'start:transform-border-label:echo -e "\x1b[0mfoo"'
2024-07-02 09:20:10 +09:00
Junegunn Choi
3b944addd4
Allow removing header line with change-header and transform-header
...
If the new header is an empty string.
fzf --header loading --bind 'start:reload:sleep 3; ls' --bind 'load:change-header:'
fzf --header loading --bind 'start:reload:sleep 3; ls' --bind 'load:transform-header:'
2024-06-25 17:14:11 +09:00
Junegunn Choi
70bf8bc35d
Add --wrap option and 'toggle-wrap' action ( #3887 )
...
* `--wrap`
* `--wrap-sign`
* `toggle-wrap`
Close #3619
Close #2236
Close #577
Close #461
2024-06-25 17:08:47 +09:00
Junegunn Choi
a70ea4654e
Fix regression in separator display
2024-06-23 18:23:46 +09:00
Junegunn Choi
b02bf9b6bb
Fix panic on extremely short terminals
...
Fix #3889
2024-06-23 11:27:03 +09:00
Junegunn Choi
7c2ffd3fef
Make transform*, --info-command, and execute-silent cancellable
...
Users can press CTRL-C after 1 second to terminate the command.
Close #3883
2024-06-22 17:24:47 +09:00
Junegunn Choi
c3cc378d89
Allow empty pointer and marker
...
Close #3879
2024-06-20 01:45:06 +09:00
Junegunn Choi
540632bb9e
Add --info-command for customizing the input text
...
Close #3866
2024-06-20 00:53:18 +09:00
Junegunn Choi
e2401aca68
Add 'offset-middle' action
2024-06-17 18:34:10 +09:00
Junegunn Choi
59943cbb48
Fire 'result' even when input stream is not complete
...
Related: #3866
2024-06-17 17:54:52 +09:00
Junegunn Choi
ed12925f7d
--sync: Suppress initial render also when focus event is bound
2024-06-17 17:00:49 +09:00
Junegunn Choi
e0ddb97ab4
Improved --sync behavior
...
When --sync is provided, fzf will not render the interface until the
initial filtering and associated actions (bound to any of 'start',
'load', or 'result') are complete.
2024-06-17 00:11:57 +09:00
Junegunn Choi
b2ecb6352c
Make GET endpoint available from 'execute' and 'transform' actions
2024-06-14 21:33:42 +09:00
Junegunn Choi
dca2262fe6
Prefer LightRenderer over tcell on Windows
...
For mouse support on mintty
Fix #3847
2024-06-12 21:53:18 +09:00
Junegunn Choi
7fc13c5cfd
Less aggressive chunk cache invalidation for --tail
2024-06-10 20:33:55 +09:00
Junegunn Choi
590060a16b
Remove unused field
2024-06-07 17:05:33 +09:00
Junegunn Choi
368294edf6
Reduce flickering of the list when the list is truncated by --tail
2024-06-07 16:59:09 +09:00
Junegunn Choi
b1460d4787
hasPreviewFlags should ignore escaped placeholder
...
This reload command wouldn't run before the fix:
: | fzf --bind 'start:reload:echo \{}'
2024-06-06 17:40:15 +09:00
Junegunn Choi
1616ed543d
Fix index out of bounds error caused by outdated offset
2024-06-06 00:23:58 +09:00
Junegunn Choi
ef148dfd37
Handle int32 overflow
...
yes | fzf --tail=10 --preview 'echo "{n}"'
2024-06-05 14:29:50 +09:00
Junegunn Choi
93bbb3032d
Add --tail=NUM to limit the number of items to keep in memory
2024-06-04 17:50:46 +09:00
Junegunn Choi
41bcbe342f
Revert "An '--expect' key should execute actions bound to the key"
...
To be backward compatible.
Close #3829
2024-06-01 13:21:59 +09:00
Junegunn Choi
49b496269c
Fix index out of bounds error on scroll-down action
2024-05-31 16:57:35 +09:00
Junegunn Choi
2f51eb2b41
Different marker for the first and last line of multi-line entries
...
Can be configured via `--marker-multi-line`
2024-05-27 01:35:05 +09:00
Junegunn Choi
1fef36e4bc
Do not allow tabs in pointer and marker
2024-05-25 16:31:34 +09:00
Junegunn Choi
7a97532547
Fix --scroll-off for multi-line mode
2024-05-24 19:23:36 +09:00
Junegunn Choi
3dee8778d0
execute: Open separate handles to /dev/tty (in, out, err)
...
# This will no longer cause 'Vim: Warning: Output is not to a terminal'
fzf --bind 'enter:execute:vim {}' > /tmp/foo
2024-05-23 21:11:12 +09:00
Junegunn Choi
a90426b7ca
Add print(...) action
2024-05-22 22:18:24 +09:00
Junegunn Choi
6b4358f641
An '--expect' key should execute actions bound to the key
...
Fix #3810
2024-05-22 20:39:09 +09:00
Junegunn Choi
076b3d0a9a
Embed man page in the binary and show it on 'fzf --man'
2024-05-21 01:06:10 +09:00
Junegunn Choi
573df524fe
Use winpty to launch fzf in Git bash (mintty)
...
Close #3806
Known limitation:
* --height cannot be used
2024-05-20 18:24:14 +09:00
Junegunn Choi
04db44067d
Implement multi-line display of multi-line items
2024-05-20 09:25:30 +09:00
Junegunn Choi
5b204c54f9
Change default pointer and marker character
...
* Pointer: '▌'
* Marker: '▏'
They will still be set to '>' if `--no-unicode` is given.
Reasons:
* They look okay
* They work better with multi-line items (WIP)
2024-05-19 15:51:32 +09:00
Junegunn Choi
04dfb14e32
Do not 'become' inside a tmux popup
...
fzf --tmux center --bind 'enter:become:vim {}'
2024-05-18 17:08:36 +09:00
Zhizhen He
01e7668915
chore: use strings.ReplaceAll ( #3801 )
2024-05-18 17:06:33 +09:00
Junegunn Choi
8a110e02b9
Fix tcell test case
2024-05-15 00:45:23 +09:00
Junegunn Choi
86d92c17c4
Refactor tui.TtyIn()
2024-05-15 00:28:56 +09:00
Junegunn Choi
af65aa298a
Add color names: selected-{fg,bg,hl}
2024-05-07 23:38:06 +09:00
Junegunn Choi
0952b2dfd4
Rename --cursor-line to --highlight-line
2024-05-07 19:22:39 +09:00
Junegunn Choi
4bedd33c59
Refactor the code to remove global variables
2024-05-07 16:58:17 +09:00
Junegunn Choi
c5fb0c43f9
Add --cursor-line to highlight the whole current line
...
Similar to 'set cursorline' of Vim.
2024-05-07 01:34:35 +09:00
Junegunn Choi
e8405f40fe
Refactor the code so that fzf can be used as a library ( #3769 )
2024-05-07 01:06:42 +09:00
Junegunn Choi
24ff66d4a9
Fix change-preview reset by change-preview-window
...
Fix #3770
2024-05-06 09:40:02 +09:00
Junegunn Choi
bf184449bc
Count $FZF_CLICK_HEADER_LINE from top to bottom
...
Regardless of `--layout`.
https://github.com/junegunn/fzf/pull/3768#issuecomment-2094806558
2024-05-06 09:27:58 +09:00
Kuremu
7b98c2c653
Add click-header event for reporting clicks within header ( #3768 )
...
Sets $FZF_CLICK_HEADER_LINE and $FZF_CLICK_HEADER_COLUMN env vars with
coordinates of the last click inside and relative to the header and
fires click-header event.
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com >
2024-05-05 18:56:43 +09:00