From owner-freebsd-bugs@FreeBSD.ORG Fri Nov 12 09:48:13 2010 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 839211065673; Fri, 12 Nov 2010 09:48:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9EA8FC1D; Fri, 12 Nov 2010 09:48:12 +0000 (UTC) Received: from c122-107-121-73.carlnfd1.nsw.optusnet.com.au (c122-107-121-73.carlnfd1.nsw.optusnet.com.au [122.107.121.73]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oAC9m8AI001153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Nov 2010 20:48:10 +1100 Date: Fri, 12 Nov 2010 20:48:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20101112202011.E1172@besplex.bde.org> Message-ID: <20101112203734.F1271@besplex.bde.org> References: <20101112010210.87641BDC46@segfault.tristatelogic.com> <20101112202011.E1172@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org, "Ronald F.Guilmette" Subject: Re: bin/152154: /bin/csh & /bin/tcsh improperly diddle termios flags X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 09:48:13 -0000 On Fri, 12 Nov 2010, Bruce Evans wrote: > On Thu, 11 Nov 2010, Ronald F.Guilmette wrote: > >>> Description: >> >> Apparently, /bin/csh (aka /bin/tcsh) is diddling termios flags, in >> particular >> the ECHO flag, for no apparently good reason and without ever even having Perhaps I shouldn't have replied to this, since my ISP was blacklisted. >> ... >> P.S. Strangely, when you run /usr/bin/script with SHELL set to /bin/tcsh >> and when you then run a program from the tcsh command prompt, that program >> will see a properly set group of termios bitflags, e.g. when and if it >> calls tcgetattr(). > > This also happens with at least bash, since bash is careful to virtualize > the terminal state by context switching it to a different value only > while in its line editor. > ... PS: probably starting the subshell in non-line-editing-mode would work, but this is no good in general since you want the subshell to run in normal mode. I don't know how to force non-line-editing-mode, especially using $SHELL. script even starts the shell with -i, which tends to imply line editing mode. I just remembered a related problem. I often mistype command lines, or do complicated editing of them involving many backspaces and other control characters to move around or search history. script makes a mess of this by showing all the control characters, even without -k. The only way to handle this right might be to have the line editor in script itself, or perhaps just between the kernel and script (the ile utility might work for this). Bruce