all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Cisco Router Tab Completion in SSH from Emacs
  2013-11-28  4:47 Cisco Router Tab Completion in SSH from Emacs Esben Stien
@ 2013-11-28  4:13 ` Stefan Monnier
       [not found] ` <mailman.7311.1385612120.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2013-11-28  4:13 UTC (permalink / raw)
  To: help-gnu-emacs

> I ssh into a Cisco Router and tab completion is not working.

I have no idea what that means.  Give us a precise description of what
you did: which command do you use, what did you expect to happen, what
happened instead...


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
       [not found] ` <mailman.7311.1385612120.10748.help-gnu-emacs@gnu.org>
@ 2013-11-28  4:41   ` Barry Margolin
  2013-11-30  4:22     ` Esben Stien
       [not found]     ` <mailman.7602.1385778203.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Barry Margolin @ 2013-11-28  4:41 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.7311.1385612120.10748.help-gnu-emacs@gnu.org>,
 Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > I ssh into a Cisco Router and tab completion is not working.
> 
> I have no idea what that means.  Give us a precise description of what
> you did: which command do you use, what did you expect to happen, what
> happened instead...

he should use M-x terminal-emulator if he wants special keys to be sent 
to the remote host. When you ssh from a comint buffer, TAB is processed 
locally by Emacs, not sent to the server.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Cisco Router Tab Completion in SSH from Emacs
@ 2013-11-28  4:47 Esben Stien
  2013-11-28  4:13 ` Stefan Monnier
       [not found] ` <mailman.7311.1385612120.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Esben Stien @ 2013-11-28  4:47 UTC (permalink / raw)
  To: help-gnu-emacs


I ssh into a Cisco Router and tab completion is not working. 

I've tried ssh from eshell and tried C-q TAB RET mentioned on IRC, which
didn't work.

I've also tried M-x ssh, but this just completes local filenames, of all
things, when doing tab completion.

I've also tried:

cd /ssh:b0ef@amador:

, but this just displays:

Tramp: Found remote shell prompt on `amador'

.. until I cancel it with C-g

Any pointers as to what is the proper way to do this?

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
  2013-11-28  4:41   ` Barry Margolin
@ 2013-11-30  4:22     ` Esben Stien
  2013-11-30 10:00       ` Peter Dyballa
  2013-12-01  2:04       ` Bob Proulx
       [not found]     ` <mailman.7602.1385778203.10748.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 10+ messages in thread
From: Esben Stien @ 2013-11-30  4:22 UTC (permalink / raw)
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> he should use M-x terminal-emulator if he wants special keys to be
> sent to the remote host.

This is something different than M-x term?

I don't have M-x terminal-emulator in my emacs-24.3.50.1, but I guess
it's the same as M-x term. 

M-x term captures everything it seems, so it kind of defeats the purpose
of running this inside emacs. 

Is there no prefix or something I can use in eshell to transmit a simple
TAB?

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
       [not found]     ` <mailman.7602.1385778203.10748.help-gnu-emacs@gnu.org>
@ 2013-11-30  8:05       ` Barry Margolin
  2013-11-30 11:54         ` Rustom Mody
  2013-12-01  1:36         ` Esben Stien
  0 siblings, 2 replies; 10+ messages in thread
From: Barry Margolin @ 2013-11-30  8:05 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.7602.1385778203.10748.help-gnu-emacs@gnu.org>,
 Esben Stien <b0ef@esben-stien.name> wrote:

> Barry Margolin <barmar@alum.mit.edu> writes:
> 
> > he should use M-x terminal-emulator if he wants special keys to be
> > sent to the remote host.
> 
> This is something different than M-x term?
> 
> I don't have M-x terminal-emulator in my emacs-24.3.50.1, but I guess
> it's the same as M-x term. 

I'm still running 22.x, but M-x term has always been short for M-x 
terminal-emulator -- it's just command completion.

> 
> M-x term captures everything it seems, so it kind of defeats the purpose
> of running this inside emacs. 
> 
> Is there no prefix or something I can use in eshell to transmit a simple
> TAB?

You can type C-q TAB, but it won't be sent until you enter the command 
line.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
  2013-11-30  4:22     ` Esben Stien
@ 2013-11-30 10:00       ` Peter Dyballa
  2013-12-01  2:04       ` Bob Proulx
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2013-11-30 10:00 UTC (permalink / raw)
  To: Esben Stien; +Cc: help-gnu-emacs


Am 30.11.2013 um 05:22 schrieb Esben Stien:

> Is there no prefix or something I can use in eshell to transmit a simple
> TAB?

I think I've read it's C-c. But better re-read! (Isn't there another prefix in ssh?)

--
Greetings

 Pete

Email is a wonderful thing for people whose role in life is to be on top of things. But not for me; my role is to be on the bottom of things. What I do takes long hours of studying and uninterruptible concentration.
				– Donald Knuth




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
  2013-11-30  8:05       ` Barry Margolin
@ 2013-11-30 11:54         ` Rustom Mody
  2013-12-01  1:36         ` Esben Stien
  1 sibling, 0 replies; 10+ messages in thread
From: Rustom Mody @ 2013-11-30 11:54 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, November 30, 2013 1:35:30 PM UTC+5:30, Barry Margolin wrote:
>  Esben Stien  wrote:
>
> > Barry Margolin > writes:
> > 
> > > he should use M-x terminal-emulator if he wants special keys to be
> > > sent to the remote host.
> > 
> > This is something different than M-x term?
> > 
> > I don't have M-x terminal-emulator in my emacs-24.3.50.1, but I guess
> > it's the same as M-x term. 
>
> I'm still running 22.x, but M-x term has always been short for M-x 
> terminal-emulator -- it's just command completion.
>
> > 
> > M-x term captures everything it seems, so it kind of defeats the purpose
> > of running this inside emacs. 
> > 
> > Is there no prefix or something I can use in eshell to transmit a simple
> > TAB?
>
> You can type C-q TAB, but it won't be sent until you enter the command 
> line.

Ive never used term myself but… maybe you should see this ?
(info "(emacs)Term Mode")


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
  2013-11-30  8:05       ` Barry Margolin
  2013-11-30 11:54         ` Rustom Mody
@ 2013-12-01  1:36         ` Esben Stien
  2013-12-01 14:56           ` ISHIKAWA,chiaki
  1 sibling, 1 reply; 10+ messages in thread
From: Esben Stien @ 2013-12-01  1:36 UTC (permalink / raw)
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> I'm still running 22.x, but M-x term has always been short for M-x 
> terminal-emulator -- it's just command completion.

Right, and running this way it kind of useless, since it makes emacs
inaccessible since everything is sent to the terminal. I could just as
well run it outside emacs. So, I guess we abandon this approach. 

> You can type C-q TAB, but it won't be sent until you enter the command 
> line.

Until I enter the command line? I don't understand this sentence. 

C-q runs the command quoted-insert, which is an interactive compiled
Lisp function in `simple.el'.

It is bound to C-q.

If I enter this in an eshell ssh session, nothing happens, at all. It
just jumps forward like hitting TAB usually does. 

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
  2013-11-30  4:22     ` Esben Stien
  2013-11-30 10:00       ` Peter Dyballa
@ 2013-12-01  2:04       ` Bob Proulx
  1 sibling, 0 replies; 10+ messages in thread
From: Bob Proulx @ 2013-12-01  2:04 UTC (permalink / raw)
  To: help-gnu-emacs

Esben Stien wrote:
> Barry Margolin writes:
> > he should use M-x terminal-emulator if he wants special keys to be
> > sent to the remote host.
> 
> This is something different than M-x term?
> 
> I don't have M-x terminal-emulator in my emacs-24.3.50.1, but I guess
> it's the same as M-x term. 
> 
> M-x term captures everything it seems, so it kind of defeats the purpose
> of running this inside emacs. 

You misunderstand.  In term mode C-c is the key prefix when in the
default character mode.  And you can toggle between character mode and
line mode easily with C-c C-j and C-c C-k.  When in line mode C-c C-j
then you don't need a prefix.  I use term quite a bit.

> Is there no prefix or something I can use in eshell to transmit a simple
> TAB?

The problem with eshell and then using ssh within it to log onto a
remote machine is that it is always in line mode.

Try using TRAMP.  This is fully documented in the tramp manual.

  5.5.4 Running `eshell' on a remote host
  ---------------------------------------
  TRAMP is integrated into `eshell.el'.  That is, you can open an
  interactive shell on your remote host, and run commands there.

Try this:

  M-x eshell
  cd /user@remote:

Or just remote if the user is the same:

  cd /remote:

I think that will do what you want.

Bob



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cisco Router Tab Completion in SSH from Emacs
  2013-12-01  1:36         ` Esben Stien
@ 2013-12-01 14:56           ` ISHIKAWA,chiaki
  0 siblings, 0 replies; 10+ messages in thread
From: ISHIKAWA,chiaki @ 2013-12-01 14:56 UTC (permalink / raw)
  To: Esben Stien; +Cc: help-gnu-emacs

(2013/12/01 10:36), Esben Stien wrote:
> Barry Margolin <barmar@alum.mit.edu> writes:
> 
>> I'm still running 22.x, but M-x term has always been short for M-x
>> terminal-emulator -- it's just command completion.
> 
> Right, and running this way it kind of useless, since it makes emacs
> inaccessible since everything is sent to the terminal. I could just as
> well run it outside emacs. So, I guess we abandon this approach.
> 
>> You can type C-q TAB, but it won't be sent until you enter the command
>> line.
> 
> Until I enter the command line? I don't understand this sentence.
> 
> C-q runs the command quoted-insert, which is an interactive compiled
> Lisp function in `simple.el'.
> 
> It is bound to C-q.
> 
> If I enter this in an eshell ssh session, nothing happens, at all. It
> just jumps forward like hitting TAB usually does.
> 

I just checked.
I logged into a local router with a CLI that supports cisco-like command
completion feature.

I used telnet.
In my case, I run M-x term and when it asks for
Run program: bash
I delete bash and inserts telnet and runs telent directly.
I think this is the key here.

This puts me in a mode where the emacs  basically captures all the
character code that is entered into telnet program.
(For example, C-x C-b to bring up dir-mode doesn't take effect.
Presumably it is all sent to the terminal program?
I can't seem to get out of this behavior of this frame/window untill
telnet is finished. So better run this "M-x term" in a separate frame, I
think. If I run "M-X term" in a new-frame, the other existing frame is
not affected by this behavior, so I can run other emacs commands there.

With running telnet directory, I did get
cisco-like completion from the router.


Yes, I am familiar with the issues mentioned because I was
not able to use cisco IOS like completion when I ran ssh from eshell
session.

I suspect what you need to do is to run "ssh" (or whatever binary that
invokes shell on your computer) when "M-x term" asks you about what
program it should run.

Hope this helps.








^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-01 14:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-28  4:47 Cisco Router Tab Completion in SSH from Emacs Esben Stien
2013-11-28  4:13 ` Stefan Monnier
     [not found] ` <mailman.7311.1385612120.10748.help-gnu-emacs@gnu.org>
2013-11-28  4:41   ` Barry Margolin
2013-11-30  4:22     ` Esben Stien
2013-11-30 10:00       ` Peter Dyballa
2013-12-01  2:04       ` Bob Proulx
     [not found]     ` <mailman.7602.1385778203.10748.help-gnu-emacs@gnu.org>
2013-11-30  8:05       ` Barry Margolin
2013-11-30 11:54         ` Rustom Mody
2013-12-01  1:36         ` Esben Stien
2013-12-01 14:56           ` ISHIKAWA,chiaki

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.