Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get GNU Emacs to TAB complete filenames after using ssh in the *shell* buffer?

Tags:

shell

emacs

ssh

I am using GNU Emacs 23.1.50.1 (i486-pc-linux-gnu).

What I want is conceptually simple, [TAB] indicates that I press the TAB key.

M-x shell

erik@furby:~$ ls
bin Desktop Documents Dropbox R.tools

erik@furby:~$ cd Drop[TAB]

and tab completion works fine (i.e., Dropbox is completed)

However, as soon as I ssh, this no longer works.

ssh [email protected]
Terminal = dumb
erik@remote:~> ls
bin private

erik@remote:~> cd priv[TAB]

and the minibuffer displays "No completions of priv"

I've found others with the same problems, but could not discern the solution.

http://www.linuxforums.org/forum/red-hat-fedora-linux/56103-tab-completion-problem-ssh-shell-through-emacs.html

Emacs remote shell

like image 820
Erik Iverson Avatar asked Oct 10 '10 16:10

Erik Iverson


People also ask

Does Emacs work over SSH?

The Emacs “Tramp” functionality brings the power of SSH into your text editor. You no longer need to open a separate terminal window in order to run scripts, edit files, or perform other server maintenance.

How do I use Emacs in terminal?

To enter Emacs, type emacs at the shell prompt. When you want to leave Emacs for a short time, type a C-z and Emacs will be suspended. To get back into Emacs, type %emacs at the shell prompt. To quit Emacs permanently, type C-x C-c.


1 Answers

OK, after I posted the question, I stumbled on dirtrack-mode , which appears to have a solution, although not entirely trivial. It uses dirtrack-mode, and the author says:

"It took me a long time to figure out how to get tab-completion working in shell-mode when I was ssh’d into another computer."

It's been annoying me for years; I'm glad I'm not the only one!

like image 168
Erik Iverson Avatar answered Sep 30 '22 02:09

Erik Iverson