Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

small problem under HP/UX (incl. workaround)

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 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@xxxxxxxxxxxxx  question--and the answer is "No!".   

Messages sorted by: Reverse Date, Date, Thread, Author