You are not logged in.

#1 2025-10-06 05:54:20

NoobArchUser
Member
Registered: 2025-10-06
Posts: 3

Autocomplete and selection using tab key

I installed bash-completion package. what should I do to enable autocompletion and selection using tab key

Thank you.

Offline

#2 2025-10-06 06:01:35

killertofus
Member
Registered: 2025-02-10
Posts: 46

Re: Autocomplete and selection using tab key

bind 'set show-all-if-ambiguous on'
bind 'TAB:menu-complete'

This doesn't make bash work exactly as zsh/other shells tho. Zsh/other shells will complete up until the next ambiguous match. Bash will just cycle through all matches.

e.g.

`$ ls ~/.ba<tab>
bashrc .bash_history .bash_profile`

* zsh: will complete up until ~/.bash and present a list of matches which handily enables you to append _ and hit `<tab>` again.
* bash: will just cycle through all ~/.ba* matches.

Offline

#3 2025-10-06 06:08:03

NoobArchUser
Member
Registered: 2025-10-06
Posts: 3

Re: Autocomplete and selection using tab key

Thank you for your help

Offline

#4 2025-10-06 06:53:25

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,258

Re: Autocomplete and selection using tab key

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#5 2025-10-07 05:25:03

NoobArchUser
Member
Registered: 2025-10-06
Posts: 3

Re: Autocomplete and selection using tab key

It seems that after reboot I cannot use tab key for selection or autocompletion. Only if I run the command again its working.

If I include these commands in bash.bashrc file will it work permanently

Last edited by NoobArchUser (2025-10-07 05:38:42)

Offline

#6 2025-10-07 07:59:50

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,258

Re: Autocomplete and selection using tab key

You're supposed to source /usr/share/bash-completion/bash_completion in some bashrc (either global or local, see https://wiki.archlinux.org/title/Bash#C … tion_files and make it a bashrc, not bash_profile)

Offline

Board footer

Powered by FluxBB