mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-01 04:32:05 -07:00
[bash] Fix completion of var or alias containing newlines (#2952)
* Fix bash completion var or aliase containing newlines * Support for various bash declare options Co-authored-by: knutze <shakte@gmail.com>
This commit is contained in:
@@ -288,13 +288,13 @@ _fzf_host_completion() {
|
||||
|
||||
_fzf_var_completion() {
|
||||
_fzf_complete -m -- "$@" < <(
|
||||
declare -xp | sed 's/=.*//' | sed 's/.* //'
|
||||
declare -xp | sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p'
|
||||
)
|
||||
}
|
||||
|
||||
_fzf_alias_completion() {
|
||||
_fzf_complete -m -- "$@" < <(
|
||||
alias | sed 's/=.*//' | sed 's/.* //'
|
||||
alias | sed -En 's|^alias ([^=]+).*|\1|p'
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user