summaryrefslogtreecommitdiff
path: root/src/tui/light.go
AgeCommit message (Collapse)Author
2025-09-23tui/light: consume full 7-byte CSI sequences to prevent leftover printing ↵Massimo Mund
(#4528) - Fix parsing in escSequence so 7-byte CSI forms (e.g. ESC [ 5 ; 10 ~) set *sz = 7 and the entire sequence is consumed. - Prevents trailing bytes (like 10~) from remaining in the input buffer and being printed as stray characters.
2025-09-05Add keybindings for CTRL, ALT, SHIFT + UP, DOWN, RIGHT, LEFT, HOME, END, ↵Massimo Mund
BACKSPACE, DELETE & more (#3996) * Added tests for `LightRenderer` * Added common SHIFT, ALT and ALT+SHIFT key sequences * Added common CTRL key sequences * Added common CTRL+ALT, CTRL+SHIFT, CTRL+ALT+SHIFT key sequences * Added proper xterm META modifier handling according to https://github.com/joejulian/xterm/blob/defc6dd5684a12dc8e56cb6973ef973e7a32caa3/input.c#L357-L375 * Fix `ctrl-backspace` and `ctrl-alt-backspace` * Fix broken tcell tests on windows by swallowing Resize events * Added tests for FullscreenRenderer * Removed own fork of tcell and updated tcell to 2.9.0 tcell 2.9.0 is needed for `Ctrl-Alt-*` and `Ctrl-Alt-Shift-*` shortcuts in Windows * Replace conditional checks with switch statements to improve readability * Replace long conditionals with constant slices to improve readability * Bind `ctrl-bspace` (`ctrl-h`) to `backward-delete-char` by default Since we now distinguish between Backspace and Ctrl-Backspace, Ctrl-Backspace should trigger the same action as Backspace by default. In that way nothing changes for the user but you can bind other actions to Ctrl-Backspace when desired.
2025-06-10Add footerJunegunn Choi
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-04-20Add --tty-default=/dev/tty and --no-tty-default option (#4352)Junegunn Choi
Fix #4242. Use --no-tty-default, if you want fzf to perform a TTY look-up instead of defaulting to /dev/tty.
2025-04-060.61.1Junegunn Choi
2025-04-06Disable bracketed paste mode on exitJunegunn Choi
Related: #4338
2025-03-22Suppress 'change' event during bracketed paste modeJunegunn Choi
Close #4316
2025-03-03[windows] Prevent fzf from consuming user input while pausedJunegunn Choi
This partly fixes #4260. fzf still can consume the first key stroke.
2025-02-16Ignore NULL byte before CSI 6N responseJunegunn Choi
Close #2455
2025-02-11Simplify codeJunegunn Choi
2025-02-11Truncate wrap signs in extremely narrow preview windowJunegunn Choi
2025-02-11Print --wrap-sign in preview windowJunegunn Choi
Close #4233
2025-02-01Add {show,hide,toggle}-input and expose $FZF_INPUT_STATEJunegunn Choi
2025-01-30Add --no-input to hide the input section (#4210)Junegunn Choi
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-27Enhance click-header eventJunegunn Choi
* Expose the name of the mouse action as $FZF_KEY * Trigger click-header on mouse up * Enhanced clickable header for `kill` completion
2025-01-25Add 'bell' action to ring the terminal bellJunegunn Choi
2025-01-20Make 'current-fg' inherit from 'fg' to simplify configurationJunegunn Choi
If you do not want 'current-fg' to inherit attributes of 'fg', prefix it with 'regular:' to reset them. # italic and underline fzf --color fg:italic,current-fg:underline # only underline fzf --color fg:italic,current-fg:regular:underline
2025-01-05Border around the header sectionJunegunn Choi
Close #4159
2025-01-02Border around the input section (prompt + info)Junegunn Choi
Close #4154
2024-12-31Add --list-border for additional border around the list sectionJunegunn Choi
Close #4148
2024-12-14Remove unused interfaceJunegunn Choi
2024-12-02Fix line wrap toggle when switching between screensJunegunn Choi
Fix #4099
2024-11-03Fix characters from previous preview not being clearedJunegunn Choi
Fix #4075
2024-08-14Support hyperlinks (OSC 8) in the main windowJunegunn Choi
Close #2557
2024-08-14Add support for hyperlinks in preview windowJunegunn Choi
Close #2165
2024-07-01Fill background color in padding areaJunegunn Choi
fzf --color bg:blue --border --padding 1,2
2024-05-23execute: Open separate handles to /dev/tty (in, out, err)Junegunn Choi
# This will no longer cause 'Vim: Warning: Output is not to a terminal' fzf --bind 'enter:execute:vim {}' > /tmp/foo
2024-05-18chore: use strings.ReplaceAll (#3801)Zhizhen He
2024-05-14Render UI directly to /dev/ttyJunegunn Choi
See https://github.com/junegunn/fzf/discussions/3792 This allows us to separately capture the standard error from fzf and its child processes, and there's less chance of user errors of redirecting the error stream and hiding fzf.
2024-05-07Refactor the code so that fzf can be used as a library (#3769)Junegunn Choi
2024-05-05Reduce flicking when changing the size of the preview window with --borderJunegunn Choi
(sleep 1; find .) | fzf --bind 'space:change-preview-window(60%|70%|80%|90%|border-left|border-right|border-vertical|border-top|border-horizontal|border-bottom|border-sharp|border-double|border-block|hidden|left|up|down|right|up|down|)' \ --preview 'cat {}' --color bg:red,preview-bg:blue \ --border --margin 3
2024-04-13Export $FZF_KEY environment variable to child processesJunegunn Choi
It's the name of the last key pressed. Related #3412
2024-04-09Disable line wrapping during renderingJunegunn Choi
Prevent unwanted line wraps that break the layout when the actual display width of a character is different than expected.
2024-03-09Fix preview area not being cleared when using certain types of border stylesJunegunn Choi
fzf --preview 'sleep 3; date' --preview-window hidden \ --bind ctrl-/:change-preview-window:up,border-bottom
2024-01-27junegunn/uniseg -> rivo/unisegJunegunn Choi
https://github.com/rivo/uniseg/pull/47
2024-01-24Fix Windows buildJunegunn Choi
Fix #3598
2024-01-21Change mattn/go-runewidth dependency to rivo/uniseg for accurate resultsJunegunn Choi
Related #3588 #3588 #3567
2024-01-14Remove 'replace' directive for 'go install' compatibilityJunegunn Choi
Close #3577
2023-11-12Fix Home, End on rxvt-unicode (#3507)Tomáš Janoušek
2023-11-10Revert "Sixel and Kitty image support on Windows binary (#2544)"Junegunn Choi
This reverts commit 68db9cb499ab32190edae6c285942c5fb7cf39ed.
2023-11-03Sixel and Kitty image support on Windows binary (#2544)Junegunn Choi
2023-11-02Fix regression where tcell renderer not clearing the preview windowJunegunn Choi
2023-11-02sixel: Export $FZF_PREVIEW_TOP to the preview command (#2544)Junegunn Choi
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.
2023-11-02sixel: Better handling of animated GIFs (#2544)Junegunn Choi
2023-10-26(Experimental) Improve Sixel graphics support (#2544)Junegunn Choi
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
2023-10-23Experimental Sixel support (#2544)Junegunn Choi
2023-10-07Experimental support for Kitty image protocol in preview windowJunegunn Choi
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 '
2023-06-10Add new border style: 'thinblock' (#3327)Mike
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-05-21Add key combinations for ctrl-delete and shift-delete (#3284)Syphdias
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>
2023-05-16Add new border style: 'block'Junegunn Choi