Ubuntu QA:
BlogBrainstormPackage status
Log in
Ubuntu QA
The Ubuntu community has contributed 21549 ideas, 132424 comments, 2606791 votes
Idea sandbox Idea sandbox
Popular ideas Popular ideas
Ideas in development Ideas in development
Implemented ideas Implemented ideas
Idea #25733: Auto completion makes things easier for advanced users as well as for new ones

Written by reic the 30 Aug 10 at 08:57. Category: Usability. Related project: Nothing/Others. Status: New
Rationale
I'm posting this referring to https://bugs.launchpad.net/ubuntu/+bug/549521

Although completion [pressing TAB after a few letters brings up the whole file/pathname in terminal] is integrated for quite a bunch of stuff, I've discovered a different behavior for the last versions of Ubuntu. For example, the use of TAB will complete sudo but not the commands following the sudo command.
This is annoying like hell, because most of the time I use the terminal, I've got to use the sudo command.

The old way was easy, safe (because you avoid typos or see them pretty fast), and quick.

I don't know why it changed from the old behavior, where even available packages after "sudo apt-get install" were shown after the first letters of the packages + TAB.

As discussed in the bugreport I've mentioned above, this seems not to be a bug but a thing Ubuntu leaves for the user to decide. You can reenable the bash autocompletion behavior before Lucid like mentioned here https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/477753.

I wonder, why this great feature should be an opt-in, since it brings so much functionality to the terminal, and people new to ubuntu and the shell may not even know this function can be extended for the sudo command as well.

192
votes
up equal down
Solution #1: Make the bash completion behavior pre-10.04 the standard again
Written by reic the 30 Aug 10 at 08:57.
Title stands for itself pretty much. This will give you:
[sudo apt-g] + [TAB] = sudo apt-get;
[sudo apt-get insta] + [TAB] = sudo apt-get install;
[sudo apt-get install nau] + [TAB] = sudo apt-get install nautilus
Here is the solution: https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/477753

Propose your solution

Attachments
No attachments.


Duplicates


Comments
tntricker wrote on the 31 Aug 10 at 02:09
I usually just use "sudo bash" and type in all of the commands I need then "exit".

Have to agree though, better auto-complete is always good.

Darwin Survivor (Brainstorm moderator) wrote on the 31 Aug 10 at 02:20
@tntricker using sudo bash doesn't work in environments where you only have access to a sub-set of commands as root (advanced visudo config) and it does NOT log to the system which commands were run by which user.

mikaelstaldal wrote on the 31 Aug 10 at 09:22
You can also use "sudo -s" or "sudo -i".

tntricker wrote on the 31 Aug 10 at 19:01
"it does NOT log to the system which commands were run by which user"

I never said it works in every case but on a home desktop (which I was assuming) it's pretty easy to tell who ran what without even looking at the logs.

I still don't understand why there's only one 'root' username(or account for that matter). If anything why doesn't shelling in with sudo make the name username_root or something similar?

snostorm wrote on the 6 Sep 10 at 19:23
Autocomplete works fine for me in both Maverick and Lucid.

auerswald wrote on the 7 Sep 10 at 06:52
Autocomplete works fine for me in Lucid, I can't reproduce the problem.

Darwin Survivor (Brainstorm moderator) wrote on the 7 Sep 10 at 09:33
I know I've had various machines running the same version of ubuntu, but some with modified .bashrc & .inputrc files and some would autocomplete apt-get, some would do it with sudo, some wouldn't do it at all. I'm pretty sure it has something to do with those settings.

Ralph Corderoy wrote on the 8 Sep 10 at 12:21
It should be left as is; not enabled in /etc. Else it applies to all users and cannot easily be undone if a particular user doesn't want it. As it stands now, each individual user can elect to enable it.

dino99 wrote on the 18 Sep 10 at 13:53
clicompanion have the necessary built-in for ease, so i vote no (no need dupes)


Post your comment