From e96bbc38dd97fc954683deef01bb6611e5d01bfb Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Fri, 26 Nov 2021 21:23:59 +0800 Subject: [PATCH] bash: completion: support termux --- .bashrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index ba66df5..9ae1807 100644 --- a/.bashrc +++ b/.bashrc @@ -216,7 +216,13 @@ export PTERM alias rssh="command ssh" alias ssh="env TERM=$PTERM ssh" -! type _completion_loader >/dev/null 2>&1 && [ -f /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion +if ! type _completion_loader >/dev/null 2>&1; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /data/data/com.termux/files/usr/share/bash-completion/bash_completion ]; then + . /data/data/com.termux/files/usr/share/bash-completion/bash_completion + fi +fi _completion_loader ssh 2>/dev/null [ $? -eq 124 ] && complete -F _ssh rssh -- 2.45.2