ble.sh icon indicating copy to clipboard operation
ble.sh copied to clipboard

Disable "automatic auto-complete" for some commands

Open L30Bola opened this issue 9 months ago • 5 comments

[leonardo.godoy@(⎈|N/A:N/A) 10:07:22 ~]:$ ble summary
GNU bash, version 5.2.37(1)-release (aarch64-apple-darwin24.2.0)
ble.sh, version 0.4.0-devel4+d4c812b (noarch) [git 2.49.0, GNU Make 4.4.1, GNU Awk 5.3.1, API 4.0, (GNU MPFR 4.2.2, GNU MP 6.3.0)]
bash-completion, version 2.16.0 (hash:480ffcc6a751e55621ec526eb5dea7a0d86d9e72, 17877 bytes) (noarch)
fzf key-bindings, (hash:8b0ef76c65a55e74cde19e726bf076349e680fe3, 5635 bytes) (noarch) (integration: on)
fzf completion, (hash:48f1a547dc867990b3765881ce374575acd8c9d6, 18422 bytes) (noarch) (integration: on)
bash-preexec (.iterm2_shell_integration.bash), (hash:dca112d748a6adb32dd0b33e831db6cf86f536a0, 24692 bytes) (noarch)
atuin, version 18.4.0 (/opt/homebrew/bin/atuin)
locale: LC_COLLATE=en_US.UTF-8 LANG=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_MEASUREMENT=pt_BR.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_MONETARY=pt_BR.UTF-8 LC_NAME=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_PAPER=pt_BR.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_TERMINAL=iTerm2 LC_TERMINAL_VERSION=3.5.12 LC_TIME=en_US.UTF-8
terminal: TERM=xterm-256color wcwidth=15.0-west/16.0-2+ri, xterm:2500 (64;2500;0)
options: +extglob +histappend -hostcomplete +histverify +inherit_errexit +login_shell

Is there a way to disable auto-complete feature but only for specified commands? Like, I love that feature, but I would like, if possible, to disable its automatic execution for commands like kubectl. I'm usually managing multiple Kubernetes clusters that are available on different regions around the world. The problem is that when my kubectl context is on a faraway cluster (for example, on Asia; I live in Brazil), it will try to auto-complete but kubectl auto-completion actually make requests to the current-context cluster. Since that is a "hanging operation", my shell "gets stuck" for 400-600ms (sometimes more) until the whole request is finished. It can be kinda boring to wait (and it's awkward when I'm pairing/sharing screen with someone, haha).

L30Bola avatar Apr 09 '25 14:04 L30Bola

This is actually a duplicate of #522, and the solution is described in Modify the completion setting dynamically - Performance.

akinomyoga avatar Apr 09 '25 15:04 akinomyoga

Oh, nice, just tested and it's working already! Thanks! Just something that started appearing: when I start a new shell, I'm receiving this (probably the order I'm loading stuff on my bashrc/blerc):

-bash: _comp_load: command not found
-bash: _comp_load: command not found

L30Bola avatar Apr 09 '25 15:04 L30Bola

Okay, I moved where I'm running those _comp_load commands and now the command not found is not happening anymore.

L30Bola avatar Apr 09 '25 18:04 L30Bola

Ah, right. I'll clarify that in the wiki page later. Thanks for the report.

akinomyoga avatar Apr 10 '25 04:04 akinomyoga

Well, TBH I didn't read the documentation, so I guess it's more my fault. Sorry.

Thank you for your time and patience, not only with my doubt but with this AMAZING project.

L30Bola avatar Apr 10 '25 13:04 L30Bola

@L30Bola please close the issue as not planned.

goyalyashpal avatar Sep 19 '25 02:09 goyalyashpal

Ah, right. I'll clarify that in the wiki page later.

I updated the wiki page on Apr 12. I'm closing the issue.

akinomyoga avatar Sep 19 '25 03:09 akinomyoga