public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: tramp on NT emacs
@ 2001-04-23 14:03 Andrew Maguire (SWW)
  2001-04-23 14:11 ` Kai Großjohann
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Maguire (SWW) @ 2001-04-23 14:03 UTC (permalink / raw)
  To: 'Kai.Grossjohann@cs.uni-dortmund.de', mah, ntemacs-users
  Cc: Keith Amidon, rcp.el mailing list, cygwin

> /----
> | revision 1.312
> | date: 2000/05/12 21:04:20;  author: grossjoh;  state: Exp;  
> lines: +19 -4
> | Don't use "set +o history 1>/dev/null 2>/dev/null".  AIX chokes on
> | redirecting stderr here?!
> \----
> 
> Isn't that nice?  So.  Can we be sure that `ls' is never a shell
> builtin, and that doing "2>/dev/null" on those commands never fails?
> I think we cannot be sure.  (And also, the exit status of `cd' is
> sometimes queried, and that's always a shell builtin.)
> 
> Does anybody have a suggestion?
I have absolutely no idea what you are trying to solve ;-)
but you might like to try:

set +o history 1>/dev/null 2>&1

You may need to do it this way around:

set +o history 2>&1 1>/dev/null

Andrew

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

* Re: tramp on NT emacs
  2001-04-23 14:03 tramp on NT emacs Andrew Maguire (SWW)
@ 2001-04-23 14:11 ` Kai Großjohann
  0 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2001-04-23 14:11 UTC (permalink / raw)
  To: Andrew Maguire (SWW)
  Cc: mah, ntemacs-users, Keith Amidon, rcp.el mailing list, cygwin

On Mon, 23 Apr 2001, Andrew Maguire wrote:

> I have absolutely no idea what you are trying to solve ;-)
> but you might like to try:
> 
> set +o history 1>/dev/null 2>&1
> 
> You may need to do it this way around:
> 
> set +o history 2>&1 1>/dev/null

I used to use `set +o history 1>/dev/null 2>&1', actually.  The
documentation for the shell tells me that this is the right order.
(The second order means that stderr goes wherever stdout normally
goes, and then stdout is changed to /dev/null.  Or something.)

But what I used to use didn't work on AIX.  The ksh there crashed or
something.  I don't quite remember.  Developing Tramp really teaches
me a lot about all the wrinkles of lots of different operating
systems.  `ls' on SunOS (I think) doesn't return a non-zero exit code
when the file unexists, for example...

Anyone with an AIX account out there who can try again?

Here's the full story:

On some systems, I do

    some_command ; echo tramp_exit_status $?

And some_command prints stuff on stderr.  So one user is getting this
output:

    tramp_exit_statusSTUFF
    FROM SOME_COMMAND GOES HERE 42

Of course, the obvious solution is to do this:

    some_command 2>/dev/null ; echo tramp_exit_status $?

But if some_command happens to be a ksh builtin and the whole thing
happens to be running on AIX -- boom!

Argh.

kai
-- 
The passive voice should never be used.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

* Re: tramp on NT emacs
  2001-04-23 12:06       ` Mark A. Hershberger
@ 2001-04-23 13:17         ` Kai Großjohann
  0 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2001-04-23 13:17 UTC (permalink / raw)
  To: Mark A. Hershberger
  Cc: Keith Amidon, rcp.el mailing list, ntemacs-users, cygwin

On 23 Apr 2001, Mark A. Hershberger wrote:

> This

I've now incorporated these changes into the current devel version.

> allowed me to get as far as a dir listing (but, strangely, only if I
> did `(setq tramp-debug-buffer t)' after the first complaint about
> not seeing an exit status).

Hm.  This seems to imply that it still isn't quite working?

kai
-- 
The passive voice should never be used.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

* Re: tramp on NT emacs
  2001-04-23 10:59     ` Kai Großjohann
@ 2001-04-23 12:06       ` Mark A. Hershberger
  2001-04-23 13:17         ` Kai Großjohann
  0 siblings, 1 reply; 7+ messages in thread
From: Mark A. Hershberger @ 2001-04-23 12:06 UTC (permalink / raw)
  To: Kai Großjohann
  Cc: Mark A. Hershberger, Keith Amidon, rcp.el mailing list,
	ntemacs-users, cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Oh, no!  What can we do?  I'm pretty sure I stopped using 2>/dev/null
> at some point, and for a reason.

Since I just want to try to get tramp working on NT emacs with
stock cygwin utils, I made the following two changes in my
tramp.el:

--- tramp/lisp/tramp.el	Wed Mar 28 15:44:30 2001
+++ .elisp/tramp.el	Mon Apr 23 13:43:52 2001
@@ -2802,7 +2802,7 @@
       (setq result
             (tramp-send-command-and-check
              multi-method method user host
-             (format "%s -lnd / >/dev/null 2>&1"
+             (format "%s -lnd / >/dev/null "
                      cmd)))
       (tramp-message 7 "Testing remote command `%s' for -n...%s"
                    cmd
@@ -3729,7 +3729,7 @@
 a subshell, ie surrounded by parentheses."
   (tramp-send-command multi-method method user host
                       (concat (if subshell "( " "")
-                              command
+                              command " 2> /dev/null"
                               (if command " ; " "")
                               "echo tramp_exit_status $?"
                               (if subshell " )" "")))


This, allowed me to get as far as a dir listing (but, strangely,
only if I did `(setq tramp-debug-buffer t)' after the first
complaint about not seeing an exit status).

Back to square one?

Mark.

-- 
		      ommnes exeunt in mysterium
		     All Things Lead into Mystery

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

* Re: tramp on NT emacs
  2001-04-23 10:49   ` Mark A. Hershberger
@ 2001-04-23 10:59     ` Kai Großjohann
  2001-04-23 12:06       ` Mark A. Hershberger
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2001-04-23 10:59 UTC (permalink / raw)
  To: Mark A. Hershberger
  Cc: Keith Amidon, rcp.el mailing list, ntemacs-users, cygwin

On 23 Apr 2001, Mark A. Hershberger wrote:

> Looking through the debug buffer, it seems to be coming from the
> following two lines:
> 
>     ls: tramp_exit_status 1
>     / this file does not exist : No such file or directory
> 
> The results of the two commands in
> 
>     ls "/ this file does not exist"; echo tramp_exit_status $?
> 
> are being interpolated.

Oh, no!  What can we do?  I'm pretty sure I stopped using 2>/dev/null
at some point, and for a reason.

I think the problem was that ksh on AIX barfs when encountering
2>/dev/null on a shell builtin.  Ah, yes, here's the log entry:

/----
| revision 1.312
| date: 2000/05/12 21:04:20;  author: grossjoh;  state: Exp;  lines: +19 -4
| Don't use "set +o history 1>/dev/null 2>/dev/null".  AIX chokes on
| redirecting stderr here?!
\----

Isn't that nice?  So.  Can we be sure that `ls' is never a shell
builtin, and that doing "2>/dev/null" on those commands never fails?
I think we cannot be sure.  (And also, the exit status of `cd' is
sometimes queried, and that's always a shell builtin.)

Does anybody have a suggestion?

kai
-- 
The passive voice should never be used.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

* Re: tramp on NT emacs
  2001-04-23  8:50 ` Keith Amidon
@ 2001-04-23 10:49   ` Mark A. Hershberger
  2001-04-23 10:59     ` Kai Großjohann
  0 siblings, 1 reply; 7+ messages in thread
From: Mark A. Hershberger @ 2001-04-23 10:49 UTC (permalink / raw)
  To: Keith Amidon; +Cc: rcp.el mailing list, ntemacs-users, cygwin

Keith Amidon <camalot@picnicpark.org> writes:

> Inspired by Mark, I've been poking around trying to get tramp working
> on nt-emacs 20.7 with the Cygwin ssh port.  I'm really
> close. Hopefully someone knows what needs to be done to take this the
> rest of the way.

I've got a quick synopsis of what I've done to attempt to get
tramp working up at < http://mah.everybody.org/docs/tramp-on-nt >.

Though I don't say so on that page, I'm getting the following
in my *Messages* buffer:

    Couldn't find exit status of `ls -d "/home/mah/.bash_profile"'

when I try find-file on /tr@su:mah@mah:/home/mah/.bash_profile.

Looking through the debug buffer, it seems to be coming from the
following two lines:

    ls: tramp_exit_status 1
    / this file does not exist : No such file or directory

The results of the two commands in

    ls "/ this file does not exist"; echo tramp_exit_status $?

are being interpolated.

So, now I need some way to ensure that STDERR and STDOUT will
wait on each other.  Looking over the bash manpage, I can't see
any way to coerce it.

Ahhh... That's about it for me.  Anyone else?

Mark.

-- 
		      ommnes exeunt in mysterium
		     All Things Lead into Mystery

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

* Re: tramp on NT emacs
       [not found] <87u24cunip.fsf@mah.mcdermott.com>
@ 2001-04-23  8:50 ` Keith Amidon
  2001-04-23 10:49   ` Mark A. Hershberger
  0 siblings, 1 reply; 7+ messages in thread
From: Keith Amidon @ 2001-04-23  8:50 UTC (permalink / raw)
  To: Mark A. Hershberger; +Cc: rcp.el mailing list, ntemacs-users, cygwin

Inspired by Mark, I've been poking around trying to get tramp working
on nt-emacs 20.7 with the Cygwin ssh port.  I'm really
close. Hopefully someone knows what needs to be done to take this the
rest of the way.

NOTE: I already have the Cygwin SSH port setup to use ssh-agent for
all authentication. So, I never have to enter ssh passwords or
passphrases within emacs to get a remote shell. I believe this is
necessary for what I have described below to work...

I'm using the very latest Cygwin openssh version (2.5.2p2-3). If you
look at the man page, you will notice a slight change to the
description of the "-t" options. It states:

   Multiple -t options force tty allocation, even if ssh has no
   local tty.

This seemed promising. I started by trying to get ssh.el working. By
doing:

   (setq ssh-explicit-args '("-t" "-t"))

I was able to use ssh.el to open ssh connnections to several machines
I use regularly, and playing around in the shell seemed to work
fine. I do get the message:

   tcgetattr: Not a character device
   tcsetattr: Not a character device

when this first connects, which I suspect this may be an indicator of
why Cygwin thinks it can't allocate a PTY for the emacs subprocess,
but I'm not sure...

Anyway, given that ssh.el seemed to be working okay, I started working
on tramp. I customized my tramp variables a bit:

   tramp-verbose = 10
   tramp-default-method = "scp"
   tramp-debug-buffer = t

And, in the tramp-methods, for method "scp" set:

   tramp-rsh-args = '("-e" "none" "-t" "-t")

I hope that makes sense. I would have just pasted the customizations
from my .emacs, but they are a bit difficult to read because
tramp-methods is so big... Let me know if you have questions.

So, now I attempt to load something remotely, first seting
debug-on-error to t so I get a backtrace when it fails. I do a
find-file on "/r@scp:amidon@camalot.picnicpark.org:"

When I do this, I get the following backtrace:

Signaling: (error "Couldn't find exit status of `test -d \"/devkits/cygwin/devkits/cygwin/bin/ln\"'")
  signal(error ("Couldn't find exit status of `test -d \"/devkits/cygwin/devkits/cygwin/bin/ln\"'"))
  error("Couldn't find exit status of `%s'" "test -d \"/devkits/cygwin/devkits/cygwin/bin/ln\"")
  tramp-send-command-and-check(nil "scp" "amidon" "camalot.picnicpark.org" "test -d \"/devkits/cygwin/devkits/cygwin/bin/ln\"" t)
  tramp-handle-file-directory-p("/r@scp:amidon@camalot.picnicpark.org:/devkits/cygwin/devkits/cygwin/bin/ln")
  apply(tramp-handle-file-directory-p "/r@scp:amidon@camalot.picnicpark.org:/devkits/cygwin/devkits/cygwin/bin/ln")
  tramp-file-name-handler(file-directory-p "/r@scp:amidon@camalot.picnicpark.org:/devkits/cygwin/devkits/cygwin/bin/ln")
  file-directory-p("/r@scp:amidon@camalot.picnicpark.org:/devkits/cygwin/bin/ln/")
  find-file-noselect("/r@scp:amidon@camalot.picnicpark.org:" nil nil 1)
  find-file("/r@scp:amidon@camalot.picnicpark.org:" 1)
  call-interactively(find-file)
  find-file-at-point()
  call-interactively(find-file-at-point)

Obviously something isn't working, but for the life of me I can't
figure out where the "/devkits/cygwin/devkits/cygwin/bin/ln" request
came from... I have cygwin installed in "c:\devkits\cygwin" on the
Win2000 machine I am attempting this from, but I don't understand
where tramp is picking this path up from...

I think I'm really close to having this working, and if anyone can
help me get over this (hopefully) last hurdle, I would really
appreciate it. The tramp-debug buffer for the request is that
generated the backtrace above is attached below if that helps.
 
    Thanks,  Keith 


-----------------
# Opening connection for amidon@camalot.picnicpark.org using scp...
# Waiting 60s for shell or passwd prompt from camalot.picnicpark.org
tcgetattr: Not a character device
tcsetattr: Not a character device
Last login: Mon Apr 23 08:26:53 2001 from dynamic-13.picnicpark.org
[amidon@camalot amidon]$ # Initializing remote shell
$ exec /bin/sh
# Waiting 30s for remote `/bin/sh' to come up...
exec /bin/sh
[amidon@camalot amidon]$ # Setting up remote shell environment
stty -inlcr -echo
[amidon@camalot amidon]$ [amidon@camalot amidon]$ # Determining coding system
foo
bar
[amidon@camalot amidon]$ # Waiting 30s for `unset HISTFILE'
[amidon@camalot amidon]$ # Waiting 30s for `set +o vi +o emacs'
set: not in vi editing mode
[amidon@camalot amidon]$ # Waiting 30s for `unset MAIL MAILCHECK MAILPATH'
[amidon@camalot amidon]$ # Waiting 30s for `unset CDPATH'
[amidon@camalot amidon]$ # Setting shell prompt
$ PS1='
/////
'; PS2=''; PS3=''
$ echo hello
# Waiting for remote `/bin/sh' to come up...
hello
# Waiting for remote `/bin/sh' to come up...done
$ echo ~root
/root
# Remote `/bin/sh' groks tilde expansion, good
# Finding command to check if file exists
$ ls -d "/" ; echo tramp_exit_status $?
/
tramp_exit_status 0
$ ls -d "/devkits/cygwin/ this file does not exist " ; echo tramp_exit_status $?
ls: /devkits/cygwin/ this file does not exist : No such file or directory
tramp_exit_status 1
# Finding a suitable `ls' command
# Checking remote `/bin/ls' command for `-n' option
$ test -x "/bin/ls" ; echo tramp_exit_status $?
tramp_exit_status 0
# Testing remote command `/bin/ls' for -n...
$ /bin/ls -lnd / >/dev/null 2>&1 ; echo tramp_exit_status $?
tramp_exit_status 0
# Testing remote command `/bin/ls' for -n...okay
# Using remote command `/bin/ls' for getting directory listings
$ tramp_set_exit_status () {
return $1
}
$ ls -d "/devkits/cygwin/devkits/cygwin/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/usr/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/usr/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/usr/sbin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/usr/sbin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/usr/local/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/usr/local/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/usr/ccs/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/usr/ccs/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/local/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/local/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/local/freeware/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/local/freeware/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/local/gnu/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/local/gnu/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/usr/freeware/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/usr/freeware/bin: No such file or directory
tramp_exit_status 1
$ ls -d "/devkits/cygwin/devkits/cygwin/usr/pkg/bin" ; echo tramp_exit_status $?
ls: /devkits/cygwin/devkits/cygwin/usr/pkg/bin: No such file or directory
tramp_exit_status 1
$ PATH=; export PATH
$ LC_TIME=C; export LC_TIME; echo huhu
huhu
$ mesg n; echo huhu
sh: mesg: No such file or directory
huhu
$ biff n ; echo huhu
sh: biff: No such file or directory
huhu
$ unalias ls; echo huhu
unalias: `ls' not an alias
huhu
$ test / -nt /
$ tramp_test_nt () {
test -n "`find $1 -prune -newer $2 -print`"
}
$ while read d; do if test -x $d/perl5 -a -f $d/perl5; then echo $d/perl5; break; fi; done <<'EOF'
$ /bin

$ /usr/bin

$ /usr/sbin

$ /usr/local/bin

$ /usr/ccs/bin

$ /local/bin

$ /local/freeware/bin

$ /local/gnu/bin

$ /usr/freeware/bin

$ /usr/pkg/bin

$ EOF

$ while read d; do if test -x $d/perl -a -f $d/perl; then echo $d/perl; break; fi; done <<'EOF'
$ /bin

$ /usr/bin

$ /usr/sbin

$ /usr/local/bin

$ /usr/ccs/bin

$ /local/bin

$ /local/freeware/bin

$ /local/gnu/bin

$ /usr/freeware/bin

$ /usr/pkg/bin

$ EOF

$ while read d; do if test -x $d/ln -a -f $d/ln; then echo $d/ln; break; fi; done <<'EOF'
$ /bin

$ /usr/bin

$ /usr/sbin

$ /usr/local/bin

$ /usr/ccs/bin

$ /local/bin

$ /local/freeware/bin

$ /local/gnu/bin

$ /usr/freeware/bin

$ /usr/pkg/bin

$ EOF

/usr/bin/perl

/////
$ cd ~; pwd
/bin/ln

/////
$ ( test -d "/devkits/cygwin/devkits/cygwin/bin/ln" ; echo tramp_exit_status $? )
/home/amidon









--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2001-04-23 14:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23 14:03 tramp on NT emacs Andrew Maguire (SWW)
2001-04-23 14:11 ` Kai Großjohann
     [not found] <87u24cunip.fsf@mah.mcdermott.com>
2001-04-23  8:50 ` Keith Amidon
2001-04-23 10:49   ` Mark A. Hershberger
2001-04-23 10:59     ` Kai Großjohann
2001-04-23 12:06       ` Mark A. Hershberger
2001-04-23 13:17         ` Kai Großjohann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).