[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp 2.1.9

From: Pete Forman
Subject: Re: Tramp 2.1.9
Date: Mon, 16 Apr 2007 14:19:09 +0100

At 2007-04-15 22:47 +0200, Michael Albinus wrote:
Pete Forman <address@hidden> writes:
> 1) tramp-shell-prompt-pattern
> This looks as if it is catering for a color reset in the prompt.  It
> only works for some common TERM settings, e.g. the first of these is
> detected okay currently:
>> tput -T vt220 sgr0 | od -c
> 0000000 033   [   m
> 0000003
>> tput -T xterm sgr0 | od -c
> 0000000 033   [   m 017
> 0000004
> I've set my var with customize but the attached patch should work.

I see your idea. Unfortunately, turning off attributes does not use
the same code everywhere. In my case, we have

magdalene:~> tput -T xterm sgr0 | od -c
0000000 033   [   m 033   (   B

A general purpose patch looks hard to me. We might only improve the
documentation I fear.

And, I might be stupid, but what is it good for to add the
exit_attribute_mode to the prompt? Wouldn't it sufficient to apply it
in your login sequence, once you have detected that you are in a dump

My problem was that TERM was set to xterm, not dumb.  I've changed
that in my PuTTY settings and updated my .login.  Now there are no
escape codes received by Tramp.

PuTTY/plink and Tramp do not fit together exactly.  PuTTY's config has
one default setting and then named sessions.  I had TERM = xterm in my
default since that is what I needed most often when setting a new
target for PuTTY.  plink uses that too.  If you try to save a session
for plink with TERM = dumb you must also set a host and username and
invoke it with different syntax.  In order to plink to different hosts
a choice has to made whether to save a named session for each host or
to change the default for PuTTY/plink.  I opted for the latter; now I
need to remember to set TERM for future PuTTY sessions.

There is no good answer as to what escape codes to allow.  As you
remarked there are many possibilities.  The current default seems to
be catering for a few of them, I was just trying to slip in some more.

The "right" thing to do is avoid escape codes in the pattern and
insist that a clean login be available. However that would disappoint
some users.  An alternative (see 5) would be to wade in with
"env PS1='$ ' ..." to get a clean prompt.

So do as you will.  My cleaned up setup works with either pattern.

> 2) configure and spaces
> I was using cygwin to configure and make.  Unfortunately it was not
> able to handle spaces in my path names.  I was able to fix a few
> obvious places, changing <foo=$bar> into <foo="$bar"> in the configure
> script.  Then I hit places where the script did an "Extract the first
> word of " and then choked on the result.  I mitigated the problem with
> a temporary symlink but I suppose I could have set PATH rather than
> using --with-xemacs="pathname_with_spaces" .

Patching the configure script might not be the best solution, because
this is a generated file from autoconf.

I was not advocating that, it was just quicker to experiment without
the extra autoconf invocation.  If it had worked I'd have submitted
changes in the source code.

When you give a pathname with whitespaces, we run into
trouble. Internally, Tramp uses the autoconf macro AC_CHECK_PROG,
which isn't able to handle withespaces in path names. And even if you
would succeed, you would need to patch also the Makefiles, because
they are not whitespace resistant as well.

I've added a short note the the installation instructions that
whitespaces are a bad idea in the path names.

That's all I was expecting.  Many scripts that originated on older
UNIX systems fail to cope with the full range of POSIX pathnames.

> 3) timer-funcs.el
> This is part of the current standard xemacs-base package.  I would
> have it (and probably a more recent Tramp) if I'd updated packages.
> The last XEmacs 21.5 full Windows installable was ages ago.

Usage of timer-funcs.el has been introduced in October 2005, by Steve
Youngs. I would expect that there are problems only somebody uses an
older XEmacs version.

> Better general advice for users would be to update their xemacs-base
> package.

Hmm, 1.5 years since. Is it really worth to document?

Probably not.  Users can now search for "timer-funcs" in this archive
if they see the error.  :-)  XEmacs 21.5 is beta and so its users
should be able to sort out this sort of thing for themselves.

> 5) remote shell discovery
> With hindsight fixing tramp-shell-prompt-pattern might have got me
> going sooner.  The default shell on my UNIX accounts is tcsh and it
> has codes to set the prompt and xterm title.  My Korn and Bash
> environments are quieter.  It would be nice if we could skip the auto
> discovery and issue "plink ... env 'PS1=$ ' /bin/sh -i" or whatever
> as the first remote command.  This could involve splitting each hop
> into a local and remote spec.  The remote part could default to
> discovery to keep existing behavior.

Honestly, here you lost me. What do you mean with "local and remote
spec"? Could you, please, give me an example?

What I meant was calling the methods something like "plink+bash"
where plink is the local program called and bash is the shell on the
remote side.  However I retracted the idea because the shell is only
one of the remote features, there are a bunch of others cached in
the connection history that have to be determined too.

That said, there is still scope for Tramp to reconnect directly to a
compliant shell without first going through the user's default shell.
There are only small gains to be had: a little bit quicker, and avoid
problems with some crufty prompts.

Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
address@hidden    -./\.-   the opinion of Schlumberger or           -./\.-   WesternGeco.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]