This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Emacs, tramp, ssh, cygwin, and what is a pseudo-terminal?


Your analysis is correct.  The output "Pseudo-terminal will not be
allocated because stdin is not a terminal." says it all.

Open a *shell* buffer in NT Emacs, and type:

.../bin$ stty
stty: standard input: Not a character device

When you are running a cygwin process inside an NT Emacs shell buffer,
cygwin thinks stdin is a pipe, not a tty.  The root cause is that
NT Emacs is a native Win32 process, it doesn't know about cygwin's
tty handling support.

There is no work-around that I am aware of presently, other than to
use XEmacs compiled with cygwin... which does handle tty properly inside
a shell buffer.  Give that a try with CYGWIN=tty enabled, and it should
work.

There is a very lengthy discussion of this in the mailing list archive
under the title "CTRL-C not working in Emacs" or something to that effect.
My name is plastered all over it.

Troy

-----Original Message-----
From: Jonadab the Unsightly One [mailto:jonadab@bright.net]
Sent: Saturday, November 10, 2001 6:32 AM
To: cygwin@cygwin.com
Subject: Emacs, tramp, ssh, cygwin, and what is a pseudo-terminal?


[Posted and mailed.]
;;;   
;;;   
I'm trying to get tramp working.  Here is what I get after
each attempt:

 ,----------------------------------------------------
 | Pseudo-terminal will not be allocated because stdin is not a terminal.
 | The authenticity of host 'croplin (xxx.xxx.xxx.xx)' can't be established.
 | RSA key fingerprint is [a bunch of incomprehensible stuff].
 | Are you sure you want to continue connecting (yes/no)? 
 | Process *tramp/sm croplin* exited abnormally with code 255
 `----------------------------------------------------

But I think this may not be tramp's fault, because I went into eshell
and tried to ssh (to the same system) and got this:

 ,----------------------------------------------------
 | Welcome to the Emacs shell
 | 
 | d:/apps/emacs $ which ssh
 | y:/ssh.exe
 | d:/apps/emacs $ ssh croplin
 | Pseudo-terminal will not be allocated because stdin is not a terminal.
 | The authenticity of host 'croplin (xxx.xxx.xxx.xx)' can't be established.
 | RSA key fingerprint is [a bunch of incomprehensible stuff].
 | Are you sure you want to continue connecting (yes/no)? yes
 | 
 `----------------------------------------------------

At this point I can hit return as many times as I like, backspace back
and erase the yes, C-q RET, whatever, to no avail.  Whatever I do,
this buffer sits and does nothing forever unless I kill it, as if the
connection between things being typed in this buffer and input into
the ssh process is broken somehow.

The drive letter Y: is mapped to the cygwin bin directory
(D:/cygwin/bin/) from AUTOEXEC.BAT and so ssh here is the cygwin copy
of ssh.exe -- which works in other circumstances.  For example, At a
cygwin bash prompt, I can do this:

 ,----------------------------------------------------
 | root@RAPTOR1 ~
 | ssh croplin
 | root@croplin's password:
 | [root@croplin /root]# ls .emacs
 | .emacs
 `----------------------------------------------------

At a garden-variety command prompt, I can do this:

 ,----------------------------------------------------
 | C:\>y:ssh croplin
 | Could not create directory '//.ssh'.
 | The authenticity of host 'croplin (xxx.xxx.xxx.xx)' can't be established.
 | RSA key fingerprint is [a bunch of incomprehensible stuff].
 | Are you sure you want to continue connecting (yes/no)? yes
 | Failed to add the host to the list of known hosts (//.ssh/known_hosts2).
 | root@croplin's password:
 | [root@croplin /root]# ls .emacs
 | .emacs
 `----------------------------------------------------

It appears that the RSA problem (which is beyond my understanding of
ssh) and the need to say "yes" stem from being outside the cygwin
environment.  No problem, I'll just say "yes" every time -- right?
But it appears that within Emacs I can't do that; somehow the "yes"
isn't getting transmitted back or something.  And tramp doesn't seem
to provide for my being prompted for this, anyway (although if that
were the only issue I could probably fix it by altering tramp, though
I'd probably have to spend some time figuring out how tramp is put
together first).  So it appears I need to resolve this by dispensing
with the need to say "yes" every time.  But I have no idea how to do
that.  (And will it even solve my problem?  When we get past the
login, will input be transmitted correctly from tramp to ssh so tramp
can do what it needs to do?)

What is the correct way to solve this?  Do I need to put an ssh.bat in
my path somewhere that sets some cygwin-related environment variables
or maybe even tunnels through bash?  Will that even solve the problem?

What is a pseudo-terminal?  Is it a problem that "input is not a
terminal" when I'm using ssh from Emacs?  Is there a way to get an
Emacs buffer to fuction _as_ a terminal?  

TIA for any pointers.  I'm not sure which angle to approach this from.

-- 
(global-set-key [f12]     'call-last-kbd-macro)
(global-set-key [f11]     'start-kbd-macro)
(global-set-key [C-f11]   'end-kbd-macro)


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]