tramp-devel
[Top][All Lists]
Advanced

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

Tramp, Plink and TERM


From: Stefan Daschek
Subject: Tramp, Plink and TERM
Date: Thu, 11 Sep 2003 12:19:05 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (windows-nt)

Tramp sets the environment variable TERM to "dumb" before starting a
ssh process, to avoid problems with fancy prompts etc. However, Plink
(the command line interface to PuTTY) ignores this variable when
setting up the remote terminal type.

I discussed this issue with the developers of PuTTY. They said it's
rather unusual for Windows applications to respect TERM anyway, and
somehow they are right. 

Unfortunately there is no command line option for specifying the
remote terminal type either, at least at the moment: For the future it
is planned to make any option settable via command line.

For now, if anyone else faces this problem, the following small patch
to PLINK.C solves it:

--8<-- snip here -->8--
*** PLINK.C.ORIG        Fri Aug 29 20:06:22 2003
--- PLINK.C     Wed Sep 10 21:12:24 2003
***************
*** 318,323 ****
--- 318,333 ----
            }
        }
      }
+     {
+       /*
+        * Override the default terminaltype if TERM is set.
+        */
+       char *p = getenv("TERM");
+       if (p) {
+         strncpy(cfg.termtype, p, sizeof cfg.termtype);
+         cfg.termtype[(sizeof cfg.termtype) - 1] = '\0';
+       }
+     }
      while (--argc) {
        char *p = *++argv;
        if (*p == '-') {
--8<-- snip here -->8--

ciao,
noniq





reply via email to

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