From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id DAA01051 for ; Tue, 22 Aug 1995 03:33:56 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA12708 (5.65c/Gatech-10.0-IDA for ); Mon, 21 Aug 1995 13:13:07 -0400 Received: by math (5.x/SMI-SVR4) id AA02933; Mon, 21 Aug 1995 12:52:31 -0400 Resent-Date: Mon, 21 Aug 1995 17:33:27 +0200 Old-Return-Path: Message-Id: <9508211533.AA17598@HPLEY1> Date: Mon, 21 Aug 1995 17:33:27 +0200 From: nk%HPLEY1@edina.xenologics.com To: zsh-list@sterling.com Subject: small problem under HP/UX (incl. workaround) Resent-Message-Id: <"4NIV1.0.jj.EdBEm"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/336 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi, zsh-2.6-beta10 has a samll but annoying problem ay least under HP/UX 9.04: If you have a running xterm and then execute su - joe with joe being a user with zsh as his login shell, the wonderful line editing options dosen't work any more. It does work if yuou ran a new xterm for joe. The problem is that the corresponding tty can't be written by joe (because it's own by me.) when accessed through it's right name. The good news it that it does work when the terminal is accessed through "/dev/tty". Therefore I changed the code in init.c to first use ttyname(0) and if this fails, use "/dev/tty" (which is used anyway if fd 0 is not a tty). Here comes the small patch: diff -u zsh-2.6-beta10/Src/init.c\~ zsh-2.6-beta10/Src/init.c --- zsh-2.6-beta10/Src/init.c~ Sat Jul 1 00:06:20 1995 +++ zsh-2.6-beta10/Src/init.c Mon Aug 21 17:22:25 1995 @@ -334,9 +334,10 @@ } /* Make sure the tty is opened read/write. */ - if (isatty(0)) + SHTTY = -1; + if (isatty(0)) SHTTY = movefd(open(ttyname(0), O_RDWR)); - else + if (SHTTY == -1) SHTTY = movefd(open("/dev/tty", O_RDWR)); if (SHTTY != -1) { Diff exited abnormally with code 1 at Mon Aug 21 17:32:03 so long Norbert Norbert Kiesel Software-Ley GmbH Lindenstr. 15 Phone: +49 2238 96600 Some say: "Microsoft is the answer." D-50259 Pulheim Fax: +49 2238 50842 This is wrong. Microsoft is the Germany Email: nk@col.sw-ley.de question--and the answer is "No!".