Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I don't know how to get the TAB key to autocomplete filenames, commands, or anything at all.

I'm on a Unix-like system (OS/390) and depend on several scripts that work in sh (Bourne shell, not BASH), but not in other shells (tcsh, for example), so I can't switch shells. I usually connect to this system via ssh or telnet from Ubuntu's GNOME Terminal running bash locally. Other people connect to the OS/390 system via telnet from the Windows XP command prompt, and they are able to autocomplete with the TAB key after issuing "set -o emacs". When I issue "set -o emacs", I get some of the appropriate functionality (ctrl-p to step backward through the history, for example), but not autocomplete.

I am aware of the "set -o vi" option, but using "ESC-*", etc does not appeal to me because I know that the simple TAB key works for other people.

Is there something about Ubuntu, the GNOME Terminal, bash, or ssh that sends a different tab character than a Windows XP command prompt running telnet?

Does anyone have an idea as to why I might not be able to get tab to autocomplete while people on that same remote machine, running the same shell, can? Or know how I might fix this?

Thanks!

share|improve this question
add comment

1 Answer

(No answer to your exact question, but many workarounds.)

You don't need to match your scripting shell with your interactive shell. (For example, most (t)csh or zsh users write sh scripts). If you have or can install a better interactive shell than the Bourne shell (zsh, bash, tcsh), go for it. Even if you can't, look if there's a ksh, which is likely to have slightly better interactive features than a Bourne shell.

You can check what character the tab key sends by entering echo ' Ctrl+V Tab ' | od -t x1 Enter. 0000000 09 0a (i.e. at position 0, two characters, a tab and a newline) is the expected output. I don't expect this to be the issue.

If you can't get a comfortable environment, you could try doing more things remotely, using your local machine for interaction as much as possible. This has its ups and downs.

  • From Linux (or most other unices including OSX, but not from Windows), you can use sshfs to access the remote filesystem.
  • Within Emacs, you can easily browse remote files via Tramp (open /os390hostname:/path/on/remote/machine, you get completion). You can also use Eshell to get a remote shell interface (an Emacs built-in shell); if you change to a remote directory (cd /os390hostname:/path/on/remote/machine), the external commands you launch will be executed on the remote machine. If you need to run commands as root, Tramp (and Eshell which is based on it) can combine ssh with su or sudo.
share|improve this answer
    
thx! ctrl+v TAB appears to just expand into a tab, as in: >echo ' '|od -t x1 0000000000 05 15 0000000002 –  ThomasGHenry Dec 15 '10 at 20:01
    
It stripped the whitespace on me! There should be a tab-sized gap between the '' and a newline before 0000000000 and 0000000002. Anyway, I'll try your remote suggestions. Thx! –  ThomasGHenry Dec 15 '10 at 20:03
    
I'd upvote this, but I don't have enough reputation in this community. –  ThomasGHenry Dec 15 '10 at 20:03
    
@ThomasGHenry: Now you do! :-) –  oKtosiTe Dec 15 '10 at 23:12
    
Yup! And I've exercised my privilege. :) –  ThomasGHenry Dec 16 '10 at 15:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.