Commit Graph

2501 Commits (7320b7df62039c879c4f609bca946ea09b438a98)
 

Author SHA1 Message Date
Junegunn Choi 7320b7df62
0.44.0 6 months ago
Tomáš Janoušek 11fb4233f7
Fix Home, End on rxvt-unicode (#3507) 6 months ago
Junegunn Choi 84bb350b14
Reset horizontal offset of the prompt on 'beginning-of-line'
https://github.com/junegunn/fzf/issues/3498#issuecomment-1806651174
6 months ago
Junegunn Choi 38e3694d1c
Revert "Sixel and Kitty image support on Windows binary (#2544)"
This reverts commit 68db9cb499.
6 months ago
dependabot[bot] 1084935241
Bump golang.org/x/sys from 0.13.0 to 0.14.0 (#3503)
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.13.0 to 0.14.0.
- [Commits](https://github.com/golang/sys/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  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>
6 months ago
Junegunn Choi f5f0b9ecaa
Fix a typo 6 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).
6 months ago
Junegunn Choi 250d507bdf
Fix a typo on CHANGELOG 6 months ago
Junegunn Choi a818653174
Add --listen-unsafe=ADDR to allow remote process execution (#3498) 6 months ago
junegunn 5c3b044740 Deploying to master from @ junegunn/fzf@c5aa8729a1 🚀 6 months ago
Junegunn Choi c5aa8729a1
Fix failing test case 6 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
6 months ago
Junegunn Choi 70c19ccf16
Fix CTRL-Z handling: Signal SIGSTOP to PGID
Fix #3501
6 months ago
Junegunn Choi 68db9cb499
Sixel and Kitty image support on Windows binary (#2544) 6 months ago
Junegunn Choi d0466fa777
Fix regression where tcell renderer not clearing the preview window 6 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.
6 months ago
Junegunn Choi a0145cebf2
sixel: Better handling of animated GIFs (#2544) 6 months ago
Junegunn Choi 69176fc5f4
fzf-preview.sh: Fall back to `stty size` (#2544) 6 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
6 months ago
Junegunn Choi 1cfa3ee4c7
fzf-preview.sh: Check the number of arguments 6 months ago
Junegunn Choi 9a95cd5794
Fix Sixel height calculation (#2544) 6 months ago
akdevservices a62fe3df6f
[completion] Handle all hostaliases in /etc/hosts (#3495)
* Fix #3488
* Handle inline comments in hosts file
7 months ago
junegunn 7701244a08 Deploying to master from @ junegunn/fzf@96e31e4b78 🚀 7 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.
7 months ago
Junegunn Choi ec208af474
Go 1.18 or above is required
Close #3492
7 months ago
Junegunn Choi 242641264d
Clear previous non-Sixel text before rendering Sixel image (#2544) 7 months ago
Junegunn Choi d3a9a0615b
Fix kitty icat handling 7 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.
7 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
7 months ago
Junegunn Choi bac385b59c
Simplify LightRenderer.Size() 7 months ago
Junegunn Choi b1a0ab8086
Experimental Sixel support (#2544) 7 months ago
junegunn a33749eb71 Deploying to master from @ junegunn/fzf@f5e4ee90e4 🚀 7 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
7 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'
7 months ago
Junegunn Choi a76c055b63
Fix inconsistent preview window width with --border
fzf --preview 'cat {}' --bind 'space:change-preview-window:up|right' --border
7 months ago
Junegunn Choi 70c461c60b
[bash] Preserve existing completion for ssh
Fix #3484
7 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>
7 months ago
junegunn 3666448ca6 Deploying to master from @ junegunn/fzf@d3311d9f43 🚀 7 months ago
Junegunn Choi d3311d9f43
0.43.0 7 months ago
LangLangBart 3e1735b06e
[zsh] Fix 'emulate: unknown argument -o' error on old zsh (#3465)
Fix #2094
7 months ago
Junegunn Choi de7ef7eace
[fzf-tmux] Fix 'empty command' error on tmux 3.2
Fix #3474
7 months ago
Christoph Anton Mitterer 7e89458a3b
[fish] exit as well when called from non-interactive shell (#3467)
Just like with the other shells, exit fish to, if called from a non-interactive
shell.

We cannot use `return`, as older versions of fish (namely < 3.4.0) did not
support to use `return` in `.`-scripts (this was only added with fish commit
3359e5d2e9bcbf19d1652636c8e448a6889302ae).

Unlike in POSIX, fish’s `exit` is however documented to no cause the calling
shell to exit when executed in a sourced script (see:
0f70b2c0d3/doc_src/cmds/exit.rst?plain=1#L20
)

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
7 months ago
Junegunn Choi f212bafe46
[bash] Remove implicit bash-completion dependency 7 months ago
Christoph Anton Mitterer 86fe40708b [bash] statically define __fzf_list_hosts() with either method
When bash-completion (and thus `_known_hosts_real()`) is / is not available this
will typically not change during the lifetime of a shell.

The only exception is if the user would unset `_known_hosts_real()`, but well,
that would be his problem.

So we can easily define `__fzf_list_hosts()` either using `_known_hosts_real()`
or using the old code, and avoid checking every time whether
`_known_hosts_real()` is defined.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
7 months ago
Christoph Anton Mitterer d718747c5b [bash] try to use bash-completions’s _known_hosts_real() for getting hostnames
If defined, use bash-completions’s `_known_hosts_real()`-function to create the
list of hostnames.
This obviously requires bash-completion to be sourced before fzf.

If not defined, fall back to the previous code.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
7 months ago
Christoph Anton Mitterer 46ee9ac41c [shell] make `__fzf_list_hosts()` definable by the user
Just like it’s already done for `_fzf_compgen_path()` and `_fzf_compgen_dir()`
allow a user to easily define his own version of `__fzf_list_hosts()`.

Also add some documentation on the expected “interface” of such custom function.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
7 months ago
Christoph Anton Mitterer f1d306feab [shell] move username prefixing code where needed
`__fzf_list_hosts()` seems like a function a user may want to override with some
custom code.
For that reason it should be kept as simple as possible, that is printing only
hostnames, one per line, optionally in some sorting.

The handling of adding a `username@` (which is then the same for each line), if
any, would unnecessarily complicate that for people who want to override the
function.
Therefore this commit moves that to the places where it's actually used (as of
now only `_fzf_complete_ssh()`).

This also saves any such handling for `_fzf_host_completion()`, where this isn’t
needed at all.

Right now it comes at a cost, namely an extra invocation of `awk` in the
`_fzf_complete_ssh()`-case.
However, it should be easily possible to improve `__fzf_list_hosts()` to no
longer need the final `awk` in the pipeline there.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
7 months ago
Christoph Anton Mitterer 2d0db98e83 [shell] don’t print error on non-existent SSH files
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
7 months ago
Junegunn Choi 3df06a1c68
Fix offset-up and offset-down with --layout=reverse (#3456) 7 months ago
dependabot[bot] a8f9432a3a
Bump golang.org/x/term from 0.12.0 to 0.13.0 (#3469)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.12.0 to 0.13.0.
- [Commits](https://github.com/golang/term/compare/v0.12.0...v0.13.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>
7 months ago