Why doesn't auto complete work in my shell?

AndreaNobili

I am not so into Linux and I have the following doubts: a client provided me an Ubuntu 18.04.3 LTS virtual machine which I access via SSH. (I am using MobaxTerm as SSH client but it should not be the problem.) The shell used is sh.

The problem is that in the shell the autocomplete function is not working as I expected using the Tab key.

It simply put the classical tab white spaces.

Why? How can I change this configuration?

Eliah Kagan

sh is provided by dash in Ubuntu. Many shells, including bash and zsh, have sophisticated features for easy interactive use. dash is deliberately quite minimal and does not offer such features. In particular, it does not offer tab completion.

Even stripped-down Ubuntu systems typically have bash installed because it is considered an essential package--we're supposed to be able to assume it is present even outside the case where another package depends on it. Typically bash is the default user shell on Ubuntu--that is, the login shell new users get by default--though this can be reconfigured.

I recommend you use bash or another shell that is nice to use interactively. You can see if bash is available in that VM by running:

bash

Assuming your $PATH is set reasonably, that will run bash if it is available. You can make sure that tab completion works in bash--it should, but there's no reason not to check--and then get tab completion in the future through one of two approaches:

  • You can just run bash when you want tab completion and other bash features.
  • You can change your user account's login shell to bash with the chsh command.

Note that there is a separate package called bash-completion which is also usually installed. This provides programmable tab completion--that is, tab completion that varies by context and, for example, knows about the flags and other syntax of commands. It's possible to have bash installed but not bash-completion.

(To find out if any particular package--bash, bash-completion, or anything else--is installed you can use apt list package-name. For more information about a package you can use apt show package-name and apt policy package-name.)

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Why my xpath doesn't work

分類Dev

Why doesn't my SetLength work?

分類Dev

Iptables: why my redirection doesn't work?

分類Dev

Why doesn't my SUMIF formula work?

分類Dev

Why doesn't my InStr Work?

分類Dev

Why auto complete does not work for directories in terminal ?

分類Dev

Why does my first snippit work, but my second doesn't?

分類Dev

Why doesn't my bash terminal recognize any command in the shell?

分類Dev

My spawning system doesn't work and I dont know why

分類Dev

Why doesn't my implementation of linked list work?

分類Dev

Why my args[1] doesn't work in this case in discord

分類Dev

Why my router navigate function doesn't work in angular 8?

分類Dev

why does my window doesn't work for on_draw?

分類Dev

Why my simple filter in Jersey doesn't work?

分類Dev

Why doesn't anything in my if-else work?

分類Dev

Why doesn't my ~/.bash_profile work?

分類Dev

Why my data-binding doesn't work?

分類Dev

Why my trash icon doesn't work in 12.04 LTS?

分類Dev

Why doesn't my HTML structure work with the CSS Grid layout?

分類Dev

Why doesn't my jQuery Mobile code work?

分類Dev

Auto play the video doesn't work in my Android Tablet with 4.4 version

分類Dev

My ShaderProgram doesn't work

分類Dev

Why isEOF doesn't work?

分類Dev

Why json doesn´t work?

分類Dev

My second endpoint doesn't work for node-js API, why?

分類Dev

Why my Vigenere encryption function for small letters doesn't work correctly?

分類Dev

Why doesn't zurb foundation off-canvas work in my project?

分類Dev

Why doesn't my program work with float variables, but it does with int variables?

分類Dev

Add Function of my MutableList doesn't work

Related 関連記事

ホットタグ

アーカイブ