package fzf import ( "errors" "fmt" "os" "regexp" "strconv" "strings" "unicode" "github.com/junegunn/fzf/src/algo" "github.com/junegunn/fzf/src/tui" "github.com/junegunn/fzf/src/util" "github.com/junegunn/go-shellwords" "github.com/rivo/uniseg" ) const Usage = `fzf is an interactive filter program for any kind of list. It implements a "fuzzy" matching algorithm, so you can quickly type in patterns with omitted characters and still get the results you want. Project URL: https://github.com/junegunn/fzf Author: Junegunn Choi * See man page for more information: fzf --man Usage: fzf [options] SEARCH -e, --exact Enable exact-match +x, --no-extended Disable extended-search mode -i, --ignore-case Case-insensitive match +i, --no-ignore-case Case-sensitive match --smart-case Smart-case match (default) --scheme=SCHEME Scoring scheme [default|path|history] -n, --nth=N[,..] Comma-separated list of field index expressions for limiting search scope. Each can be a non-zero integer or a range expression ([BEGIN]..[END]). --with-nth=N[,..] Transform the presentation of each line using field index expressions -d, --delimiter=STR Field delimiter regex (default: AWK-style) +s, --no-sort Do not sort the result --literal Do not normalize latin script letters --tail=NUM Maximum number of items to keep in memory --disabled Do not perform search --tiebreak=CRI[,..] Comma-separated list of sort criteria to apply when the scores are tied [length|chunk|pathname|begin|end|index] (default: length) INPUT/OUTPUT --read0 Read input delimited by ASCII NUL characters --print0 Print output delimited by ASCII NUL characters --ansi Enable processing of ANSI color codes --sync Synchronous search for multi-staged filtering GLOBAL STYLE --style=PRESET Apply a style preset [default|minimal|full[:BORDER_STYLE] --color=COLSPEC Base scheme (dark|light|16|bw) and/or custom colors --no-color Disable colors --no-bold Do not use bold text DISPLAY MODE --height=[~]HEIGHT[%] Display fzf window below the cursor with the given height instead of using fullscreen. A negative value is calculated as the terminal height minus the given value. If prefixed with '~', fzf will determine the height according to the input size. --min-height=HEIGHT Minimum height for percent --height is given in percent (default: 10 or above depending on the other options) --tmux[=OPTS] Start fzf in a tmux popup (requires tmux 3.3+) [center|top|bottom|left|right][,SIZE[%]][,SIZE[%]] [,border-native] (default: center,50%) LAYOUT --layout=LAYOUT Choose layout: [default|reverse|reverse-list] --margin=MARGIN Screen margin (TRBL | TB,RL | T,RL,B | T,R,B,L) --padding=PADDING Padding inside border (TRBL | TB,RL | T,RL,B | T,R,B,L) --border[=STYLE] Draw border around the finder [rounded|sharp|bold|block|thinblock|double|horizontal|vertical| top|bottom|left|right|none] (default: rounded) --border-label=LABEL Label to print on the border --border-label-pos=COL Position of the border label [POSITIVE_INTEGER: columns from left| NEGATIVE_INTEGER: columns from right][:bottom] (default: 0 or center) LIST SECTION -m, --multi[=MAX] Enable multi-select with tab/shift-tab --highlight-line Highlight the whole current line --cycle Enable cyclic scroll --wrap Enable line wrap --wrap-sign=STR Indicator for wrapped lines --no-multi-line Disable multi-line display of items when using --read0 --track Track the current selection when the result is updated --tac Reverse the order of the input --gap[=N] Render empty lines between each item --gap-line[=STR] Draw horizontal line on each gap using the string (default: '┈' or '-') --keep-right Keep the right end of the line visible on overflow --scroll-off=LINES Number of screen lines to keep above or below when scrolling to the top or to the bottom (default: 0) --no-hscroll Disable horizontal scroll --hscroll-off=COLS Number of screen columns to keep to the right of the highlighted substring (default: 10) --jump-labels=CHARS Label characters for jump mode --pointer=STR Pointer to the current line (default: '▌' or '>') --marker=STR Multi-select marker (default: '┃' or '>') --marker-multi-line=STR Multi-select marker for multi-line entries; 3 elements for top, middle, and bottom (default: '╻┃╹') --ellipsis=STR Ellipsis to show when line is truncated (default: '··') --tabstop=SPACES Number of spaces for a tab character (default: 8) --scrollbar[=C1[C2]] Scrollbar character(s) (each for list section and preview window) --no-scrollbar Hide scrollbar --list-border[=STYLE] Draw border around the list section [rounded|sharp|bold|block|thinblock|double|horizontal|vertical| top|bottom|left|right|none] (default: rounded) --list-label=LABEL Label to print on the list border --list-label-pos=COL Position of the list label [POSITIVE_INTEGER: columns from left| NEGATIVE_INTEGER: columns from right][:bottom] (default: 0 or center) INPUT SECTION --prompt=STR Input prompt (default: '> ') --info=STYLE Finder info style [default|right|hidden|inline[-right][:PREFIX]] --info-command=COMMAND Command to generate info line --separator=STR Draw horizontal separator on info line using the string (default: '─' or '-') --no-separator Hide info line separator --filepath-word Make word-wise movements respect path separators --input-border[=STYLE] Draw border around the input section [rounded|sharp|bold|block|thinblock|double|horizontal|vertical| top|bottom|left|right|none] (default: rounded) --input-label=LABEL Label to print on the input border --input-label-pos=COL Position of the input label [POSITIVE_INTEGER: columns from left| NEGATIVE_INTEGER: columns from right][:bottom] (default: 0 or center) PREVIEW WINDOW --preview=COMMAND Command to preview highlighted line ({}) --preview-window=OPT Preview window layout (default: right:50%) [up|down|left|right][,SIZE[%]] [,[no]wrap][,[no]cycle][,[no]follow][,[no]info] [,[no]hidden][,border-STYLE] [,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES] [,default][,