emacs-devel
[Top][All Lists]
Advanced

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

Re: Feature freeze and Tramp?


From: Kai Grossjohann
Subject: Re: Feature freeze and Tramp?
Date: Wed, 12 May 2004 09:32:48 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux)

Luc Teirlinck <address@hidden> writes:

> Kai Grossjohann wrote:
>
>    Cool!  Thanks for the fix, will incorporate this into Tramp shortly.
>
> That leaves us with the issue of those three remaining lines which are
> still somewhat of a nuisance.  They can be completely gotten rid of by
> setting tramp-initial-commands to
>
> ("unset HISTFILE" "unset correct" "unset autocorrect")
>
> where the order is, of course, important.  In other words "unset
> HISTFILE" is pushed onto the default value.

I have added this.  It should be harmless at worst, and useful in many
cases.

> ("HISTFILE=" "export HISTFILE" "unset correct" "unset autocorrect")
>
> would, I believe, make the 
>
> "HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE"
>
> unnecessary, but I am afraid that some shells might not recognize "export".
> However, was there any reason to use "HISTFILE=$HOME/.tramp_history;
> HISTSIZE=1;" instead of simply using "HISTFILE= ; export HISTFILE" at the
> same spot?

The initial commands are sent to the login shell, which might be a
csh, and a csh doesn't grok export.  Therefore, putting export into
the initial commands doesn't seem to be right.

Bash isn't the only shell grokking HISTFILE and/or HISTSIZE; I think
the above construction was made to work with bash and ksh.  I'd have
to dig it up in the Tramp mailing list archives to find out which
shells have been tested.

In general, it is difficult to keep track of which shell is active at
any one moment, and which commands might cause problems.  For
instance, I used to have "unset foo >/dev/null; blah", only to find
out that some shells fail to execute blah if output from the builtin
is redirected...  

Regarding HISTFILE/HISTSIZE, I could find the following ChangeLog
entry:

2001-01-10  Kai Großjohann  <address@hidden>

        * tramp.el (tramp-open-connection-setup-interactive-shell): `unset
        HISTFILE' rather than `set -o history' to turn off the history.
        Pete Forman says this works on bash1 and bash2, but not for ksh or
        a Posix sh.  He also says there's no way to turn history off for
        ksh and Posix shells, except by invoking non-interactively.  I
        won't do that, though, because I need the prompts.

HISTSIZE isn't mentioned at all, though.  Hm.  Ah, another entry:

2001-04-13  Kai Großjohann  <address@hidden>

        * tramp.el (tramp-open-connection-setup-interactive-shell): Posix
        shells don't allow you to turn off the history, so we redirect it
        to an innocuous file and limits that file's size as much as
        possible.
        (tramp-find-executable): Be extra careful when searching for
        executables, include sentinel string to search for.

Does this help?

Kai





reply via email to

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