summaryrefslogtreecommitdiff
path: root/shell/completion.bash
AgeCommit message (Collapse)Author
2025-09-24Apply shfmt to bash script files (make fmt)Junegunn Choi
2025-09-24make lint: Perform bash script lintingJunegunn Choi
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-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-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-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
2024-10-15Use eval to evaluate $post variable as command. (#4023)Thomas Martitz
2024-09-23[bash] Fix infinite retry loop for completion setting without "-F func" (#4004)Koichi Murase
2024-08-22[bash] Revert skipping setting up fuzzy path completionJunegunn Choi
This partially reverts a2d0e8f not to break backward compatibility.
2024-08-11[bash] Enable fuzzy path completion for all commands (#3958)Junegunn Choi
All commands with no custom completion defined. Close #3957
2024-08-07fix: Add fallback for cygwin ps (#3955)Eduardo D Sanchez
2024-07-08[bash] Add code to the default list of programs to support completionJunegunn Choi
Close #3843
2024-07-06[completion] Use --wrap option in process completionJunegunn Choi
And remove the short preview window for showing the whole command. Because it is important to be able to see the whole command before deciding to kill it.
2024-06-03Add new options to bash completionJunegunn Choi
2024-05-09chore: Update flags to include long-form options for case (#3785)LangLangBart
2024-05-07[shell] Add $FZF_COMPLETION_{DIR,PATH}_OPTSJunegunn Choi
To allow separately overriding 'walker' options. Close #3778
2024-04-27[completion] Add undocumented bash variables for completion commandsJunegunn Choi
And allow empty FZF_COMPLETION_DIR_COMMANDS
2024-04-25Make completion.bash load fasterJunegunn Choi
* Reduce number of `__fzf_orig_completion < <(complete -p "$@" 2> /dev/null)`s * Clean up options in fzf completion * Remove telnet completion
2024-04-19Respect $FZF_DEFAULT_OPTS_FILE in key bindings and completion (#3742)Junegunn Choi
Fix #3740
2024-04-10[shell] Revert interactiveness checks for evalJunegunn Choi
So that there's no error even when the scripts are mistakenly evaluated in non-interactive sessions. bash -c 'eval "$(fzf --bash)"; echo done' zsh -c 'eval "$(fzf --zsh)"; echo done' * https://github.com/junegunn/fzf/pull/3675#issuecomment-2044860901 * https://github.com/junegunn/fzf/commit/f103aa4753b435f8f45c5130323effeb75583c15
2024-04-04[bash] Add -o nospace to dir completion options (#1987)Junegunn Choi
2024-04-04[bash] Remove -o default from dir completion options (#1987)Junegunn Choi
2024-04-04[bash] Fix variable completion of directory-related commandsJunegunn Choi
Fix #1987
2024-03-29[bash-completion] Make dynamic loader return 124 to retry completionJunegunn Choi
Close #3702
2024-03-17[bash] Fix default completion of unset, unalias, etcJunegunn Choi
Fix #3679
2024-03-13Add walker options and replace 'find' with the built-in walker (#3649)Junegunn Choi
2024-03-13[bash] Fix regression in dynamic completionJunegunn Choi
Fix #3674
2024-03-10[bash] Update orig_complete after _completion_loaderKoichi Murase
2024-03-10[bash] Refactor access to "_fzf_orig_complete_${cmd//[^A-Za-z0-9_]/_}"Koichi Murase
In the current codebase, for the original completion settings, the pieces of the codes to determine the variable name and to access the stored data are scattered. In this patch, we define functions to access these variables. Those functions will be used in a coming patch. * This patch also resolves an inconsistent escaping of "$cmd": $cmd is escaped as ${...//[^A-Za-z0-9_]/_} in some places, but it is escaped as ${...//[^A-Za-z0-9_=]/_} in some other places. The latter leaves the character "=" in the command name, which causes an issue because "=" cannot be a part of a variable name. For example, the following test case produces an error message: $ COMP_WORDBREAKS=${COMP_WORDBREAKS//=} $ _test1() { COMPREPLY=(); } $ complete -vF _test1 cmd.v=1.0 $ _fzf_setup_completion path cmd.v=1.0 $ cmd.v=1.0 [TAB] bash: _fzf_orig_completion_cmd_v=1_0: invalid variable name The behavior of leaving "=" was present from the beginning when saving the original completion is introduced in commit 91401514, and this does not seem to be a specific reasoning. In this patch, we replace "=" as well as the other non-identifier characters. * Note: In this patch, the variable REPLY is used to return values from functions. This design is to make it useful with the value substitutions, a new Bash feature of the next release 5.3, which is taken from mksh.
2023-10-29[completion] Handle all hostaliases in /etc/hosts (#3495)akdevservices
* Fix #3488 * Handle inline comments in hosts file
2023-10-19[bash] Preserve existing completion for sshJunegunn Choi
Fix #3484
2023-10-13[bash] Remove implicit bash-completion dependencyJunegunn Choi
2023-10-12[bash] statically define __fzf_list_hosts() with either methodChristoph Anton Mitterer
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>
2023-10-12[bash] try to use bash-completions’s _known_hosts_real() for getting hostnamesChristoph Anton Mitterer
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>