Autocompletion in Terminal is slow - Ubuntu

This is a discussion on Autocompletion in Terminal is slow - Ubuntu ; Hello, if I type s.th. like "sudo apt-get install pa" and press the Tab-Key in order to auto complete to "sudo apt-get install pan" it takes several seconds until the auto completion is done. During that, the terminal is stuck. ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: Autocompletion in Terminal is slow

  1. Autocompletion in Terminal is slow

    Hello,

    if I type s.th. like "sudo apt-get install pa" and press the Tab-Key in
    order to auto complete to "sudo apt-get install pan" it takes several
    seconds until the auto completion is done.
    During that, the terminal is stuck. Before it was always quick but for a
    short time it gets distracting.

    The auto completion of stuff like the "install" after "apt-get" works
    quickly but especially stuff like program-names e.g. have this problem.

    Is there any way to fix that?

    Greets

  2. Re: Autocompletion in Terminal is slow

    Julian wrote:
    > if I type s.th. like "sudo apt-get install pa" and press the Tab-Key in
    > order to auto complete to "sudo apt-get install pan" it takes several
    > seconds until the auto completion is done.


    "s.th."? Oh, "something". Right.


    > The auto completion of stuff like the "install" after "apt-get" works
    > quickly but especially stuff like program-names e.g. have this problem.


    The completion code is having to look up a full list of package names
    ("apt-cache pkgnames"). On my system there are over 35000 of them so
    it's not really surprising it takes a little while.


    > Is there any way to fix that?


    Not really. Be impressed that it even works at all.
    Chris

  3. Re: Autocompletion in Terminal is slow

    On Sun, 12 Oct 2008 12:12:19 +0100, Chris Davies wrote:
    >Julian wrote:
    >> if I type s.th. like "sudo apt-get install pa" and press the Tab-Key in
    >> order to auto complete to "sudo apt-get install pan" it takes several
    >> seconds until the auto completion is done.


    >"s.th."? Oh, "something". Right.


    I'm surprised that works at all. It used to be that all autocmplete
    did was regular espression/wildcard expansion and a comparison against
    the current directory. Ie: type fu and if there was a file
    called fubar, only no other matches, it would complete it.

    Asking a package manager to consult a packages database is far far far
    more timeconsuming that just geting a file list.

  4. Re: Autocompletion in Terminal is slow

    In article ,
    AZ Nomad wrote:
    > On Sun, 12 Oct 2008 12:12:19 +0100, Chris Davies
    > wrote:
    > >Julian wrote:
    > >> if I type s.th. like "sudo apt-get install pa" and press the Tab-Key in
    > >> order to auto complete to "sudo apt-get install pan" it takes several
    > >> seconds until the auto completion is done.

    >
    > >"s.th."? Oh, "something". Right.

    >
    > I'm surprised that works at all. It used to be that all autocmplete
    > did was regular espression/wildcard expansion and a comparison against
    > the current directory. Ie: type fu and if there was a file
    > called fubar, only no other matches, it would complete it.
    >
    > Asking a package manager to consult a packages database is far far far
    > more timeconsuming that just geting a file list.


    How do I tell the system _not_ to do that? I don't want it to search
    for a typoed program every time, like so:

    eben@pc:~$ bum
    The program 'bum' is currently not installed. You can install it by
    typing:
    sudo apt-get install bum
    bash: bum: command not found

    All I want is bash's response.

    --
    -eben QebWenE01R@vTerYizUonI.nOetP royalty.mine.nu:81
    LIBRA: A big promotion is just around the corner for someone
    much more talented than you. Laughter is the very best medicine,
    remember that when your appendix bursts next week. -- Weird Al

  5. Re: Autocompletion in Terminal is slow

    * Hactar wrote in alt.os.linux.ubuntu on 2008-10-12:

    [..]

    >> Asking a package manager to consult a packages database is far far far
    >> more timeconsuming that just geting a file list.


    > How do I tell the system _not_ to do that? I don't want it to search
    > for a typoed program every time, like so:


    > eben@pc:~$ bum
    > The program 'bum' is currently not installed. You can install it by
    > typing:
    > sudo apt-get install bum
    > bash: bum: command not found


    > All I want is bash's response.


    That is bash's response, you aren't asking the same question, but the
    answer to yours is, that is the expected and correct behavior, in your
    case, it is searching your PATH$, if you stop it from doing that, you
    will only be able to run programs by specifying the full path, you don't
    want that.

    The question above relates to tab-auto-completion in that the shell
    knows you are running apt-get with the install option and when hitting
    it will provide a list of valid programs to install.


    --
    David | Fight Back!
    The bomb will never go off. I speak as an expert in explosives.
    -- Admiral William Leahy, U.S. Atomic Bomb Project

  6. Re: Autocompletion in Terminal is slow

    Hactar wrote:

    > eben@pc:~$ bum
    > The program 'bum' is currently not installed. You can install it by
    > typing:
    > sudo apt-get install bum
    > bash: bum: command not found
    >
    > All I want is bash's response.


    If you don't want this message, you have to remove the
    package 'command-not-found'.

  7. Re: Autocompletion in Terminal is slow

    * Tobias Brandt wrote in alt.os.linux.ubuntu on 2008-10-12:
    > Hactar wrote:


    >> eben@pc:~$ bum
    >> The program 'bum' is currently not installed. You can install it by
    >> typing:
    >> sudo apt-get install bum
    >> bash: bum: command not found


    >> All I want is bash's response.


    > If you don't want this message, you have to remove the
    > package 'command-not-found'.


    Hrumph! I misread the error. I have actually never seen that behavior,
    interesting.
    --
    David | Fight Back!
    I must follow the people. Am I not their leader? -Benjamin Disraeli

  8. Re: Autocompletion in Terminal is slow

    SINNER wrote:
    > * Tobias Brandt wrote in alt.os.linux.ubuntu on 2008-10-12:
    >> Hactar wrote:

    >
    >>> eben@pc:~$ bum
    >>> The program 'bum' is currently not installed. You can install it by
    >>> typing:
    >>> sudo apt-get install bum
    >>> bash: bum: command not found

    >
    >>> All I want is bash's response.

    >
    >> If you don't want this message, you have to remove the
    >> package 'command-not-found'.

    >
    > Hrumph! I misread the error. I have actually never seen that behavior,
    > interesting.


    For this less than avid learner, bum is an interesting package.
    http://www.marzocca.net/linux/bum.html

    --
    Bob
    "I don't believe in evil, I believe in right and wrong, and very
    often they are the same thing"-Paul Theroux, in Milroy the Magician.


  9. Re: Autocompletion in Terminal is slow

    In article ,
    Bob wrote:
    > SINNER wrote:
    > > * Tobias Brandt wrote in alt.os.linux.ubuntu on 2008-10-12:
    > >> Hactar wrote:

    > >
    > >>> eben@pc:~$ bum
    > >>> The program 'bum' is currently not installed. You can install it by
    > >>> typing:
    > >>> sudo apt-get install bum
    > >>> bash: bum: command not found

    > >
    > >>> All I want is bash's response.

    > >
    > >> If you don't want this message, you have to remove the
    > >> package 'command-not-found'.

    > >
    > > Hrumph! I misread the error. I have actually never seen that behavior,
    > > interesting.

    >
    > For this less than avid learner, bum is an interesting package.
    > http://www.marzocca.net/linux/bum.html


    I had no idea. I just picked a short, relatively common word (therefore
    likely to be a package name) that I'd nevertheless not heard attached to
    a package. ::read read:: Nifty. How would one manage that stuff
    otherwise, manually?

    --
    -eben QebWenE01R@vTerYizUonI.nOetP royalty.mine.nu:81
    LIBRA: A big promotion is just around the corner for someone
    much more talented than you. Laughter is the very best medicine,
    remember that when your appendix bursts next week. -- Weird Al

  10. Re: Autocompletion in Terminal is slow

    AZ Nomad wrote:

    > On Sun, 12 Oct 2008 12:12:19 +0100, Chris Davies wrote:
    >>Julian wrote:
    >>> if I type s.th. like "sudo apt-get install pa" and press the Tab-Key in
    >>> order to auto complete to "sudo apt-get install pan" it takes several
    >>> seconds until the auto completion is done.

    >
    >>"s.th."? Oh, "something". Right.

    >
    > I'm surprised that works at all. It used to be that all autocmplete
    > did was regular espression/wildcard expansion and a comparison against
    > the current directory. Ie: type fu and if there was a file
    > called fubar, only no other matches, it would complete it.


    That's the standard completion, but Ubuntu enables bash's programmable
    completion by default.


    Florian
    --

    -----------------------------------------------------------------------
    ** Hi! I'm a signature virus! Copy me into your signature, please! **
    -----------------------------------------------------------------------

  11. Re: Autocompletion in Terminal is slow

    Tobias Brandt wrote:
    > If you don't want this message, you have to remove the
    > package 'command-not-found'.


    Now how did you know that?

    --
    As we enjoy great advantages from inventions of others, we should be
    glad of an opportunity to serve others by any invention of ours;
    and this we should do freely and generously.
    --Benjamin Franklin

  12. Re: Autocompletion in Terminal is slow

    johnny bobby bee wrote:

    > Tobias Brandt wrote:
    >> If you don't want this message, you have to remove the
    >> package 'command-not-found'.

    >
    > Now how did you know that?
    >


    I once tried to reduce the size of my installation to a minimum. So I
    searched the package library for packages I could remove. Wich means I had
    to read most of the package descriptions. This was one of them.

  13. Re: Autocompletion in Terminal is slow

    Hactar wrote:
    > I don't want it to search for a typoed program every time, like so:


    > eben@pc:~$ bum
    > The program 'bum' is currently not installed. You can install it by
    > typing:
    > sudo apt-get install bum
    > bash: bum: command not found


    That's an entirely different question altogether. It looks like you've
    got the command-not-found package installed.

    Chris


  14. Re: Autocompletion in Terminal is slow

    Tobias Brandt wrote:
    > If you don't want this message, you have to remove the
    > package 'command-not-found'.


    johnny bobby bee wrote:
    > Now how did you know that?


    Search google for parts of the error text and pick the top most likely
    candidate. It refers to a package called command-not-found. Dig around
    some more using that as an additional key.

    Chris

  15. Re: Autocompletion in Terminal is slow

    Julian schrieb:
    > Hello,
    >
    > if I type s.th. like "sudo apt-get install pa" and press the Tab-Key in
    > order to auto complete to "sudo apt-get install pan" it takes several
    > seconds until the auto completion is done.
    > During that, the terminal is stuck. Before it was always quick but for a
    > short time it gets distracting.
    >
    > The auto completion of stuff like the "install" after "apt-get" works
    > quickly but especially stuff like program-names e.g. have this problem.
    >
    > Is there any way to fix that?
    >
    > Greets


    Of course, if you want to complete a long command on a quite big System
    like linux, auto-completion can be slow. There is a way to fix: Type
    yourself or use auto completion only, if you have small commands to
    complete.
    My own experience is, that if you' re a practiced typer, you should be
    faster with your fingers.

+ Reply to Thread