summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorknutze <34371397+knutze@users.noreply.github.com>2022-09-10 11:38:41 +0900
committerGitHub <noreply@github.com>2022-09-10 11:38:41 +0900
commitb9e6e7926cb8400ad56de60f66d6b4fc2b391c6e (patch)
tree4560f7100dd12dde2110c7012ce1735651b7de18 /shell
parent845034c81c38c42e2fe1b0be925b150506e6089d (diff)
[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>
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index c7d73818..4b1e0dba 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -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'
)
}