From owner-freebsd-current@FreeBSD.ORG Fri Oct 21 12:27:57 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD9B106566B for ; Fri, 21 Oct 2011 12:27:57 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id A71D18FC15 for ; Fri, 21 Oct 2011 12:27:56 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 4C6D2358C56; Fri, 21 Oct 2011 14:27:55 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 332B028468; Fri, 21 Oct 2011 14:27:55 +0200 (CEST) Date: Fri, 21 Oct 2011 14:27:55 +0200 From: Jilles Tjoelker To: Garrett Cooper Message-ID: <20111021122754.GA18273@stack.nl> References: <20111021065912.GE1874@hoeg.nl> <20111021070839.GF1874@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Ed Schouten , FreeBSD Current Subject: Re: Not setting TERM explicitly wraps commands at 80 columns with nested shells in xterms using sh + bash? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2011 12:27:57 -0000 On Fri, Oct 21, 2011 at 12:52:17AM -0700, Garrett Cooper wrote: > # Increased the window size here. > [gcooper@fallout ~]$ uname -a > FreeBSD fallout.local 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r226332M: > Wed Oct 12 22:48:55 PDT 2011 > root@fallout.local:/usr/obj/usr/src/sys/FALLOUT amd64 > [gcooper@fallout ~]$ stty size > 60 156 > [gcooper@fallout ~]$ exit > Connection to fallout.local closed. > [gcooper@bayonetta ~]$ uname -a > FreeBSD bayonetta.local 9.0-BETA2 FreeBSD 9.0-BETA2 #0 r225653M: Tue > Sep 20 08:36:49 PDT 2011 > gcooper@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA amd64 > [gcooper@bayonetta ~]$ stty size > 60 156 > # Line was wrapping in above uname -a. > [gcooper@bayonetta ~]$ ssh starr-wireless > # Increased the window size here from the default. > starr:~ gcooper$ uname -a > Darwin starr.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 > 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 > starr:~ gcooper$ echo $TERM > xterm > starr:~ gcooper$ logout > Connection to starr-wireless.local closed. > [gcooper@bayonetta ~]$ uname -a > FreeBSD bayonetta.local 9.0-BETA2 FreeBSD 9.0-BETA2 #0 r225653M: Tue > Sep 20 08:36:49 PDT 2011 > gcooper@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA amd64 > ssh'ing in to a remote terminal and resizing it is an example I > could think of that's semi-deterministic. It seems like it's an > application bug or OS caveat; I'm not sure if anything can really be > done about it because the signal might be masked in ssh when it > connects to the other side -- would have to check to be sure. By default, bash only updates its internal idea of the window size (and the LINES and COLUMNS environment variables) when it receives SIGWINCH, so only if bash is in the foreground when the change happens. You can do shopt -s checkwinsize to make it check more often. libedit (as used in sh) is different; it appears to check the size before reading each line. -- Jilles Tjoelker