From owner-freebsd-questions Mon Sep 3 1: 3:15 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-94-248-46.mmcable.com [24.94.248.46]) by hub.freebsd.org (Postfix) with SMTP id 41EFE37B401 for ; Mon, 3 Sep 2001 01:03:12 -0700 (PDT) Received: (qmail 89170 invoked by uid 100); 3 Sep 2001 08:03:10 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15251.14654.625217.863635@guru.mired.org> Date: Mon, 3 Sep 2001 03:03:10 -0500 To: "Bob Hall" Cc: questions@freebsd.org Subject: Re: Setting TERM for ssh In-Reply-To: <123713767@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Bob Hall types: > On Sun, Sep 02, 2001 at 05:25:01AM -0500, Mike Meyer wrote: > > Bob Hall types: > > > Does anyone know how to set TERM for ssh? The ssh man pages say that you > > > can do this, but they don't say how. I've been researching and > > > experimenting for several days now, but haven't found the answer. > > The man pages on 4.4-RC don't say you can set the terminal > > environment. However, it does say that sshd reads > > $HOME/.ssh/environment for lines of the form "name=value" to add to > > the environment. Would that do what you're looking for? > My conception of what happens at the start of an ssh session is that > my ssh software reads the TERM setting in $HOME/.ssh/environment and > passes that to my remote account. I think you've got it backwards, but the information is in the sshd man page, not the ssh man page. That's because sshd reads $HOME/.ssh/environment on the remote system, and adds those things to the environment before it starts your shell. So you need to create $HOME/.ssh/environment on the remote system - or check the documentation on the ssh daemon it's running if it's not a FreeBSD system. > The remote account receives the TERM value for the current shell, > regardless of the setting in the environment file. This really is the most desirable behavior. The correct terminal type depends more on the remote system than the local system - so you need to set it on the remote system, not the local one. However, most Unix systems have similar - if not identical - terminal descriptions, so passing the current value across the wire is a reasonable first guess. > If I set the bash > TERM to vt220, I can use the remote account without problem, but > applications that use color are monochrome. If I set TERM in the > environment file, the remote account complains about the 'cons25' > setting. I'm trying to find a way to set TERM for the ssh session, > and only for the ssh session. Is this possible, or does the ssh > session have to have it's own terminal with it's own shell in order > to have it's own TERM value? And if so, what is the point of the > environment file? I'm sure it does something, but what? You could just alias ssh to "TERM=vt200 /usr/bin/ssh", assuming you're using an sh-like shell. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message