Commit Graph

985 Commits (ec70acd0b9e65a5feb7d07d54eccc0be624559f0)

Author SHA1 Message Date
Tomáš Janoušek 11fb4233f7
Fix Home, End on rxvt-unicode (#3507) 11 months ago
Junegunn Choi 84bb350b14
Reset horizontal offset of the prompt on 'beginning-of-line'
https://github.com/junegunn/fzf/issues/3498#issuecomment-1806651174
11 months ago
Junegunn Choi 38e3694d1c
Revert "Sixel and Kitty image support on Windows binary (#2544)"
This reverts commit 68db9cb499.
11 months ago
Junegunn Choi 230fc49ae2
(Experimental) Add support for iTerm2 inline image protocol
Close #1102

  fzf --preview 'imgcat -W $FZF_PREVIEW_COLUMNS -H $FZF_PREVIEW_LINES {}'

Notes:
* There is no good way to determine the height of the rendered image,
  so we assume that the image takes the full height of the preview
  window. So the image cannot be displayed with the other text.
* fzf-preview.sh script was updated to use `imgcat` if it's available
  but `chafa` is not.
* iTerm2 also supports Sixel, so adding support for this protocol is not
  quite necessary but it renders animated GIFs much better (e.g. looping).
11 months ago
Junegunn Choi a818653174
Add --listen-unsafe=ADDR to allow remote process execution (#3498) 11 months ago
Junegunn Choi c5aa8729a1
Fix failing test case 11 months ago
Junegunn Choi 3f78d76da1
Allow accepting remote connections
Close #3498

  # FZF_API_KEY is required for a non-localhost listen address
  FZF_API_KEY=xxx fzf --listen 0.0.0.0:6266
11 months ago
Junegunn Choi 70c19ccf16
Fix CTRL-Z handling: Signal SIGSTOP to PGID
Fix #3501
11 months ago
Junegunn Choi 68db9cb499
Sixel and Kitty image support on Windows binary (#2544) 11 months ago
Junegunn Choi d0466fa777
Fix regression where tcell renderer not clearing the preview window 11 months ago
Junegunn Choi 21ab64e962
sixel: Export $FZF_PREVIEW_TOP to the preview command (#2544)
So that it can determine if it should subtract 1 from $FZF_PREVIEW_LINES
to avoid scrolling issue of Sixel image that touches the bottom of the
screen.
11 months ago
Junegunn Choi a0145cebf2
sixel: Better handling of animated GIFs (#2544) 11 months ago
Junegunn Choi 278dce9ba6
Restore scroll after rendering full-height Sixel image (#2544)
When a Sixel image touches the bottom of the screen, the whole screen
scrolls up one line to make room for the cursor. Add an ANSI escape
code to compensate for the movement. Unfortunately, the movement of the
screen is sometimes noticeable.

  fzf --preview='fzf-preview.sh {}' --preview-window border-left
11 months ago
Junegunn Choi 9a95cd5794
Fix Sixel height calculation (#2544) 11 months ago
Junegunn Choi 96e31e4b78
Fix Sixel issues (#2544)
* Fix regression where previous image is not properly cleared
* Change the way fzf calculates the number of required lines to display
  an image (ceil -> floor) to fix the issue where an image is always
  rendered as a wireframe.
11 months ago
Junegunn Choi 242641264d
Clear previous non-Sixel text before rendering Sixel image (#2544) 11 months ago
Junegunn Choi 3277e8c89c
Remove $FZF_PREVIEW_PIXEL_{WIDTH,HEIGHT} (#2544)
They are not neccessary because we can use a program such as chafa that
can resize images by the terminal columns and lines.
11 months ago
Junegunn Choi d02b9442a5
(Experimental) Improve Sixel graphics support (#2544)
Progress:

* Sixel image can now be displayed with other text, and is scrollable
* If an image can't be displayed entirely due to the scroll offset, fzf
  will render a wireframe to indicate that an image should be displayed
* Renamed $FZF_PREVIEW_{WIDTH,HEIGHT} to $FZF_PREVIEW_PIXEL_{WIDTH,HEIGHT}
  for clarity
* Added bin/fzf-preview.sh script to demonstrate how to display an image
  using Kitty or Sixel protocol

An example:

  ls *.jpg | fzf --preview='seq $((FZF_PREVIEW_LINES*9/10)); fzf-preview.sh {}; seq 100'

A known issue:

* If you reduce the size of the preview window, the image may extend
  beyond the preview window
11 months ago
Junegunn Choi bac385b59c
Simplify LightRenderer.Size() 11 months ago
Junegunn Choi b1a0ab8086
Experimental Sixel support (#2544) 11 months ago
Junegunn Choi f5e4ee90e4
Fix bug where top section of the previous preview content appearing
when the preview window is re-enabled and the current preview process is
taking more than 500ms and previewDelayed is triggered

  fzf --preview 'sleep 1; date; seq 1000' --bind space:toggle-preview
11 months ago
Junegunn Choi 690d5e6dbd
Fix scrollability of the preview window when preview offset is specified
This should not be scrollable

  fzf --preview 'seq $FZF_PREVIEW_LINES' --preview-window '~5'
11 months ago
Junegunn Choi a76c055b63
Fix inconsistent preview window width with --border
fzf --preview 'cat {}' --bind 'space:change-preview-window:up|right' --border
11 months ago
Laurent Cheylus d51b71ee80
Fix crash on OpenBSD with --listen (#3483)
- src/protector/protector_openbsd.go: add inet permissions for pledge
  - fix #3481

Signed-off-by: Laurent Cheylus <foxy@free.fr>
11 months ago
Junegunn Choi 3df06a1c68
Fix offset-up and offset-down with --layout=reverse (#3456) 12 months ago
Junegunn Choi 404b6a864b
Add offset-up and offset-down
# Scrolling will behave similarly to CTRL-E and CTRL-Y of vim
  fzf --bind scroll-up:offset-up,scroll-down:offset-down \
      --bind ctrl-y:offset-up,ctrl-e:offset-down \
      --scroll-off=5

Close #3456
12 months ago
Junegunn Choi 391aa14845
Add mouse events for --bind
Close #3473
12 months ago
Junegunn Choi d8188fce7b
Experimental support for Kitty image protocol in preview window
Close #3228

* Works inside and outside of tmux
* There is a problem where fzf unnecessarily displays the scroll offset
  indicator at the topbright of the screen when the image just fits the
  preview window. This is because `kitty icat` generates an extra line
  after the image area.

    # A 5-row images; an extra row at the end confuses fzf
    ["\e_Ga ... \e[9C􎻮̅̅ࠪ􎻮̅̍ࠪ􎻮̅̎ࠪ􎻮̅̐ࠪ􎻮̅̒ࠪ􎻮̅̽ࠪ􎻮̅̾ࠪ􎻮̅̿ࠪ􎻮̅͆ࠪ􎻮̅͊ࠪ􎻮̅͋ࠪ\n",
     "\r\e[9C􎻮̍̅ࠪ􎻮̍̍ࠪ􎻮̍̎ࠪ􎻮̍̐ࠪ􎻮̍̒ࠪ􎻮̍̽ࠪ􎻮̍̾ࠪ􎻮̍̿ࠪ􎻮̍͆ࠪ􎻮̍͊ࠪ􎻮̍͋ࠪ\n",
     "\r\e[9C􎻮̎̅ࠪ􎻮̎̍ࠪ􎻮̎̎ࠪ􎻮̎̐ࠪ􎻮̎̒ࠪ􎻮̎̽ࠪ􎻮̎̾ࠪ􎻮̎̿ࠪ􎻮̎͆ࠪ􎻮̎͊ࠪ􎻮̎͋ࠪ\n",
     "\r\e[9C􎻮̐̅ࠪ􎻮̐̍ࠪ􎻮̐̎ࠪ􎻮̐̐ࠪ􎻮̐̒ࠪ􎻮̐̽ࠪ􎻮̐̾ࠪ􎻮̐̿ࠪ􎻮̐͆ࠪ􎻮̐͊ࠪ􎻮̐͋ࠪ\n",
     "\r\e[9C􎻮̒̅ࠪ􎻮̒̍ࠪ􎻮̒̎ࠪ􎻮̒̐ࠪ􎻮̒̒ࠪ􎻮̒̽ࠪ􎻮̒̾ࠪ􎻮̒̿ࠪ􎻮̒͆ࠪ􎻮̒͊ࠪ􎻮̒͋ࠪ\n",
     "\r\e[39m\e8"]

* Example:

  fzf --preview='
    if file --mime-type {} | grep -qF 'image/'; then
      # --transfer-mode=memory is the fastest option but if you want fzf to be able
      # to redraw the image on terminal resize or on 'change-preview-window',
      # you need to use --transfer-mode=stream.
      kitty icat --clear --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {}
    else
      bat --color=always {}
    fi
  '
12 months ago
Junegunn Choi 76364ea767 Remove unnecessary escaping in the default command 1 year ago
Junegunn Choi 901939bd96
Add support for limit and offset parameters for GET / endpoint
Related #3372
1 year ago
Junegunn Choi 4490b2d209
Respect ANSI codes to reset properties
Fix #3441
1 year ago
Junegunn Choi 0f50dc848e
Add 'GET /' endpoint for getting the program state (experimental)
Related #3372
1 year ago
Junegunn Choi f50a7058d6
Fix center-alignment of border/preview label
Fix #3421
1 year ago
Junegunn Choi dd59b8c7b9
Fix ANSI color continuation in --header
# Both lines should be in red
  fzf --header $'\x1b[31mfoo\nbar'
1 year ago
Junegunn Choi f83491274f
Add toggle-header option
Close #3358
1 year ago
Boaz Yaniv c0435fdff4
Add API Keys for fzf --listen (#3374) 1 year ago
Bart 3c09c77269
Fix deprecations of ioutil (#3370) 1 year ago
Junegunn Choi 547e101f1d
Use $SHELL instead of bash if it's known to support 'pipefail'
when running the default find command

Close #3339
Close #3364
1 year ago
Junegunn Choi 63aa5d3b4e
Correct outdated comment 1 year ago
guangwu 4772bd8d4c
Use strings.ContainsRune instead (#3335) 1 year ago
Junegunn Choi d0b7780239
Add --info=right
Related: #3322
1 year ago
Junegunn Choi e627ca6bd7
Add --info=inline-right
Close #3322
1 year ago
Junegunn Choi c97172bdd4
Fix background color of spinner on the preview window 1 year ago
Mike ce8a745fb4
Add new border style: 'thinblock' (#3327)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
1 year ago
Junegunn Choi 448d7e0c5a
Update test case 1 year ago
Junegunn Choi 4c70745cc1
Fix bug where preview is not updated after reload when --disabled is set
Fix #3311
1 year ago
Junegunn Choi 7795748a3f
Remove dead code 1 year ago
Syphdias 37f258b1bf
Add key combinations for ctrl-delete and shift-delete (#3284)
Currently there is not option to bind ctrl-delete and shift-delete. As
suggested by issue #3240, shift-delete could be used to bind "delete
entry from history" as it is a common way to do so in other
applications, e.g. browsers.

This, however, does only implement to use the key combination itself and
does not assign a default action to any of them. This does enable to
call one's all predefined actions. With the exec action this can
expanded like the issue #3240 suggested.
If desirable, the key combinations could later get a default behavior.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
1 year ago
Junegunn Choi 16b0aeda7d
Make sure 'become' process is given a proper tty device 1 year ago
Junegunn Choi 86e4f4a841
Update tcell renderer to support block border 1 year ago
Junegunn Choi 607eacf8c7
Allow unbind(focus)
Fix #3279
1 year ago
Junegunn Choi 7a049644a8
Fix panic when trying to render preview window of a negative height
Fix #3292
1 year ago
Junegunn Choi 17a13f00f8
Allow customizing scrollbar of the preview window via --scrollbar=xy 1 year ago
Junegunn Choi 43436e48e0
Add new border style: 'block' 1 year ago
Junegunn Choi 5a39102405
Allow customizing the color of preview scrollbar via 'preview-scrollbar' 1 year ago
Junegunn Choi 94999101e3
Fix the behavior of change-preview-window action (#3280)
* change-preview-window restores the initial preview window options,
  and overrides the properties that are specified
* However, 'hidden' property is treated differently. It is set to
  'false' if the specified properties of the action is non-empty.
* cf. toggle-preview takes the "current" preview window options and
  toggles the 'hidden' property.
1 year ago
Junegunn Choi e619b7c4f4
Fix the background color of the scrollbar inside the preview window 1 year ago
Junegunn Choi b7c2e8cb67
Fix caching when reload and query change triggered by the same binding 1 year ago
Junegunn Choi fb76893e18
0.40.0 1 year ago
Junegunn Choi 88d812fe82
Do not display trailing carriage returns in the preview window
Close #3269
1 year ago
Junegunn Choi 77f9f4664a
Fix search not triggered when query change and reload happen at the same time
Fix #3268
1 year ago
Junegunn Choi cf95e44cb4
Add 'zero' event
Close #3263
1 year ago
Junegunn Choi 65dd2bb429
Add 'track' action 1 year ago
Junegunn Choi 6be855be6a
Add change-header and transform-header
Close #3237
1 year ago
Junegunn Choi 0c61d81713
Add toggle-track action 1 year ago
Junegunn Choi 7c6f5dba63
Fixed --track when used with --tac
Fix #3234
1 year ago
Junegunn Choi 96670d5f16
Disallow using --track with --tac
Close #3234
1 year ago
tyama711 fb019d43bf
Fix a bug of height range with -1 or -0 (#3226)
Fixed a bug that when both heightUnknown and deferred are true, deferred is not properly reset and the program terminates abnormally.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
1 year ago
Junegunn Choi 8ec917b1c3
Add 'one' event
Close #2629
Close #2494
Close #459
2 years ago
Junegunn Choi 1c7534f009
Add --track option to track the current selection
Close #3186
Related #1890
2 years ago
Junegunn Choi 60f37aae2f
Respect 'regular' attribute in 'bw' base theme
Don't make the text bold if an element is explicitly specified as
'regular'.

Fix #3222
2 years ago
Junegunn Choi d7daf5f724
Render CR and LF as ␍ and ␊
Close #2529
2 years ago
Junegunn Choi fcd7e8768d
Omit port number in `--listen` for automatic port assignment
Close #3200
2 years ago
Junegunn Choi 3c34dd8275
Fix extra new line in the preview window
When a colored text ends at the right end of the window

Fix #3209
2 years ago
Zhizhen He 3364d4d147
Add spell check workflow (#3183) 2 years ago
Junegunn Choi b1459c79cf
Make sure that the query before the cursor is not hidden
Close #3176
2 years ago
Junegunn Choi 4e305eca26
become: Set stdin to /dev/tty 2 years ago
Junegunn Choi 96c3de12eb
Run 'become' only when the command template is properly evaluated 2 years ago
Junegunn Choi 6ea38b4438
Add become(...) action that replaces current fzf process
Close #3159
2 years ago
Junegunn Choi f7447aece1
Code cleanup 2 years ago
Junegunn Choi aa2b9ec476
Add 'show-preview' and 'hide-preview'
For cases where 'toggle-preview' is not enough
2 years ago
Junegunn Choi 3ee00f8bc2
toggle-preview should not show empty preview window 2 years ago
Junegunn Choi fccab60a5c
`--preview-window 0,hidden` should not execute the preview command
Until `toggle-preview` action is triggered

Fix #3149
2 years ago
Junegunn Choi 95a7661bb1
Sanitize input strings that should be a single line 2 years ago
Junegunn Choi 618d317803
Support custom separator of inline info
Close #2030
Close #3084
2 years ago
Junegunn Choi ae897c8cdb
No need to touch mouse flag if it's already false 2 years ago
Junegunn Choi d0a0f3c052
Temporarily disable mouse mode when switching to an external command 2 years ago
Junegunn Choi 91b9591b10
Reenable mouse mode when coming back from an external program
Close #3141
2 years ago
Junegunn Choi aa7361337d
Make test case pass on 32-bit platforms
Close #3127
2 years ago
Junegunn Choi 284d77fe2e
Add 'focus' event
Can we find a better name? I have considered the followings.

* 'point', because "the pointer" points to the current item.
* 'shift', 'switch', 'move', etc. These are not technically correct
  because the current item can change without cursor movement (--tac,
  reload, search update)
* 'change' is already taken. 'change-current' feels a bit wordy and
  sounds wrong, 'current-changed' is wordy and doesn't go well with the
  other event names
* 'target', not straightforward

Close #3053
2 years ago
Junegunn Choi 826178f1e2
Do not restore terminal state while running an external command 2 years ago
Junegunn Choi d51980a3f5 Add 'transform-border-label' and 'transform-preview-label' 2 years ago
jpcrs c3d73e7ecb Add change-border-label and change-preview-label actions, update man 2 years ago
Junegunn Choi b077f6821d
Action argument in enclosed form should allow new lines
Close #3138
2 years ago
Junegunn Choi 2023011763
0.36.0 2 years ago
Junegunn Choi dc8da605f9
Fix rendering of double-column borders on light renderer 2 years ago
Junegunn Choi 8b299a29c7
Fix rendering of double-column borders 2 years ago
Junegunn Choi 0c5956c43c
Better support for Windows terminals
* Default border style on Windows is changed to `sharp` because some
  Windows terminals are not capable of displaying `rounded` border
  characters correctly.
* If your terminal emulator renders each box-drawing character with
  2 columns, set `RUNEWIDTH_EASTASIAN` environment variable to `1`.
2 years ago
Junegunn Choi e97e925efb
Resume preview following if the user scrolls the window to the bottom 2 years ago
Junegunn Choi e0f0984da7
Allow re-enabling preview follow on change-preview-window 2 years ago