summaryrefslogtreecommitdiff
path: root/shell
AgeCommit message (Collapse)Author
2025-10-12feat: Allow disabling Ctrl-R binding in shell integration (#4535)Jacobo de Vera
Close #4417
2025-10-09CTRL-R: Bind ALT-R to toggle-rawJunegunn Choi
2025-10-09Add '--bind ctrl-x:toggle-raw' to CTRL-R bindingsJunegunn Choi
2025-09-24Apply shfmt to bash script files (make fmt)Junegunn Choi
2025-09-24make lint: Perform bash script lintingJunegunn Choi
2025-08-19[bash 3] Fix CTRL-T and ALT-C to preserve the last yank (#4496)xty
2025-07-25fix(shell): check for mawk existence before version check (#4468)LangLangBart
close #4463
2025-06-09[bash,zsh] Skip comments in ~/.ssh/configKoichi Murase
For the line "Host host1 # this is a comment", the current implementation generates words in an inline comment as hostnames. This patch removes the comment before generating the hostname.
2025-06-09[bash,zsh] Support "=" after "Hostname" and "Host" in ~/.ssh/configKoichi Murase
In ~/.ssh/config, "=" can also be used as a separator between the field name and the value. The current master does not properly handle this and generate a hostname "=" or one starting with "=". This patch correctly handles it.
2025-06-09[bash,zsh] Remove redundant filtering-out of comment/blank linesKoichi Murase
Comments are anyway removed in the subsequent call to `sub(/#.*/, "")`, and it becomes a blank line. Blank lines do not have fields, so they are ignored in the next for-loop.
2025-06-09[bash,zsh] Correctly exclude the hostname "0.0.0.0"Koichi Murase
In the current implementation, any hostnames in /etc/hosts containing "0.0.0.0" as a part (such as "110.0.0.0" would be excluded. "0.0.0.0" should be checked by the exact match.
2025-06-09[bash,zsh] Do not end the hostname analysis on "]" in ~/.ssh/known_hostsKoichi Murase
An entry of the form `[example.com]:port,192.168.0.1 ...` in ~/.ssh/known_hosts are not properly processed. The current implementation gives up the matching on the first occurrence of `]`, the subsequent 192.168.0.1 would not be extracted. This patch continues the analysis and removes "]" together with "[". This patch also removes the ":port" part from the hostnames in ~/.ssh/known_hosts. One cannot use the form "hostname:port" in the arguments to the ssh command anyway.
2025-06-09[bash,zsh] Process hostnames with uppercase letters in known_hostsKoichi Murase
2025-06-08[bash,zsh] Separate common functions into "shell/common.sh"Koichi Murase
2025-06-08[bash,zsh] Work around mawk 1.3.3-20090705 not supporting the POSIX bracketsKoichi Murase
2025-06-08[bash,zsh] Work around Solaris awk, which is non-standardKoichi Murase
Solaris awk at /usr/bin/awk is meant for backward compatibility with an ancient implementation of 1977 awk in the original UNIX. It lacks many features of POSIX awk. To use a standard-conforming version in Solaris, one needs to explicitly use /usr/xpg4/bin/awk.
2025-06-08[bash,zsh] Work around a quirk of macOS awkKoichi Murase
macOS awk is a variant of nawk, but it contains a unique patch for the UTF-8 support. However, this patch causes the problem. If the input contains any non-UTF-8 data, macOS awk stops processing and does not do anything, instead of ignoring the unrecognized data and continue the processing. However, the contents of the ssh configuration and /etc/hosts is not under the control of fzf, so we cannot fix the input when those files contain non-UTF-8 data. To work around this behavior, one can set the locale to LC_ALL=C to treat the input data with the plain 8-bit encoding.
2025-06-05[bash,zsh] Reduce the number of fork & execKoichi Murase
2025-06-05[zsh] Set shell options for pathname expansion "~/.ssh/config.d/*"Koichi Murase
This applies the same changes as commit 0a06fd6f for Bash (GitHub PR
2025-06-03[bash] Set shell options for pathname expansion "~/.ssh/config.d/*" (#4405)Koichi Murase
2025-05-30[bash] Fix 'complete' errors when IFS is newlineJunegunn Choi
Fix #4342
2025-05-10bash: set keybinding right before printing special character (#4377)Ajeet D'Souza
2025-04-28[fish] Support deleting history items with SHIFT-DELbitraid
Bind to SHIFT-DELETE a command that deletes the selected history items. It can be overridden by $FZF_CTRL_R_OPTS.
2025-04-28[fish] Simplify commandline call in fzf-file-widgetbitraid
2025-04-28[fish] Add version checkbitraid
2025-04-28[fish] History: Operate only on line at cursorbitraid
This allows inserting history entries when constructing multiline commands.
2025-04-18[fish] Improve option prefix processingbitraid
- Support single-letter options without = such as -fFILEPATH - fish v3.3.0 and newer: Disable option prefix if -- is preceded
2025-04-18[fish] Fix whitespace/regex characters in command linebitraid
This is a rewrite of __fzf_parse_commandline function, that fixes the following issues, when CTRL-T/ALT-C is used and current command line token contains: - Escaped newlines (\n): This never worked correctly, but after 282884a, the string would split, and the script would enter an infinite loop while trying to set $dir. - Escaped bell (\a, \cg), backspace (\b), form feed (\v, \cl), carriage return (\r), vertical tab (\v, \ck): walker-root would not set correctly for existing directories containing any of those characters. - Regular expression special characters (^, +, ? etc): $dir would not be be stripped from $fzf_query if it contained any of those characters. The lowest supported fish version is v3.1b. For optimal operation, the function uses more recent commands when supported by the running version. Specifically, for versions equal or newer than: - v3.2.0: Sets variables using PCRE2 capture groups of `string match --regex` when needing to preserve any trailing newlines and simultaneously omit the extra newline that is appended by `string collect -N`. - v3.5.0: Uses the builtin path command for path normalization, dirname extraction and existing directories check. - v4.0.0: Uses the --tokens-expanded option of commandline, for expansion and dealing with unbalanced quotes and incomplete escape sequences. It also uses the regex style of string-escape, to prepare variable contents for regex operations. This is not used in older versions, because they don't escape newlines.
2025-04-18[fish] Fix for file/dir names containing newlinesbitraid
CTRL-T/ALT-C now works correctly when selecting files or directories that contain newlines in their names. When external commands defined by $FZF_CTRL_T_COMMAND/$FZF_ALT_C_COMMAND are used (for example the fd command with -0 switch), the --read0 option must also be set through $FZF_CTRL_T_OPTS/$FZF_ALT_C_OPTS.
2025-03-17[bash] Fix $FZF_COMPLETION_{DIR,PATH}_OPTS to support non-trivial argumentsJunegunn Choi
This used to fail with 'unknown option: World>' export FZF_COMPLETION_PATH_OPTS="--prompt 'Hello World> '"
2025-02-26[fish] Enable multiple history commands insertion (#4280)bitraid
Enable inserting multiple history commands. To disable, set `--no-multi` through `$FZF_CTRL_R_OPTS`. Also, remove the usage of `become` action, to avoid leaving behind temporary files. Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-02-20[zsh/key-bindings] don't unescape FZF_DEFAULT_OPTS (addendum: #4262)Junegunn Choi
2025-02-20[zsh/completion] don't unescape FZF_DEFAULT_OPTS (#4262)Steve Williams
2025-02-20[fish] Add comment about fish version compatibilitybitraid
2025-02-20[fish] Reorder functionsbitraid
Move the helper functions to the top of the main function, and the main function commands (bind command) to the bottom.
2025-02-20[fish] Refactor bind commandsbitraid
Use single check for each default command variable.
2025-02-20[fish] Refactor fzf-cd-widgetbitraid
- Remove check/set of FZF_TMUX_HEIGHT variable. It is already done by __fzf_defaults. - Remove unnecessary begin/end block. - Simplify result variable check. - Set the command line using a single call to commandline.
2025-02-20[fish] Refactor fzf-history-widgetbitraid
- Remove check/set of FZF_TMUX_HEIGHT variable. It is already done by __fzf_defaults. - Remove unnecessary begin/end block. - Pass all fzf options (except query) through FZF_DEFAULT_OPTS variable.
2025-02-20[fish] Refactor fzf-file-widgetbitraid
- Remove check/set of FZF_TMUX_HEIGHT variable. It is already done by __fzf_defaults. - Remove unnecessary begin/end block. - Simplify result variable check. - Insert file names using a single call to commandline.
2025-02-20[fish] Refactor __fzf_parse_commandline, remove __fzf_get_dirbitraid
The __fzf_get_dir function was called only once, and was basically a single command in a while loop.
2025-02-20[fish] __fzfcmd: Don't set FZF_TMUXbitraid
The FZF_TMUX variable check has already been changed from numeric to string, so there is no need to set it to 0 if it's empty or undefined.
2025-02-20[fish] Refactor __fzf_defaultsbitraid
Append all arguments after the first one, so that functions don't have to pass all appending options as a single string. Also, output everything as a single string (an array of one item).
2025-02-11[fish] Unescape query from commandline (#4236)bitraid
More natural processing of the query taken from command line, by unquoting/unescaping the token. Unescaped open quotes are removed. Because of how `string unescape` works, if both single and double quotes are present, with the outer quotes open, only the outer quotes are removed. Examples: `'foo bar'`, `"foo bar"`, `foo\ bar` becomes `foo bar` `"foobar`, `'foobar`, `foo"bar`, `foo'bar` becomes `foobar` `'"foo"'`, `'"foo"` becomes `"foo"` `"'foo'"`, `"'foo'` becomes `'foo'` `"'foo` becomes `'foo` `'"foo` becomes `"foo`
2025-02-08[fish] Fix for directories with special characters (#4230)bitraid
Using CTRL-T or ALT-C when the current command line token contained a directory with special characters, the script would fail to detect it. For exampe, an existing directory named `it\'s\ a\ test`, instead of using it as walker-root, it would use it as the query.
2025-01-28[fish] Improve fish binary path detection (#4208)bitraid
Instead of exporting a local `$SHELL` containing the location of fish in `$PATH` when global `$SHELL` is not fish, always set `--with-shell` with the actual binary path of fish that the function is running from.
2025-01-28Enhance --min-height option to take number followed by +Junegunn Choi
2025-01-27[completion] Replace 'tr' with built-in string substitutionJunegunn Choi
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-26[completion] Make kill completion header clickableJunegunn Choi
2025-01-24[fish] Fix compatibility with v3.1.2 - v3.3.1 (#4200)bitraid
Don't use the command substitution syntax: $(cmd) Fix #4196