zsh-workers
 help / color / mirror / code / Atom feed
* Ultrix typeahead fix
@ 1995-06-08 11:17 P.Stephenson
  1995-06-08 18:59 ` Richard Coleman
  0 siblings, 1 reply; 2+ messages in thread
From: P.Stephenson @ 1995-06-08 11:17 UTC (permalink / raw)
  To: Zsh hackers list

I reported a couple of days ago that typeahead was broken on Ultrix
(4.3, at least).

I'm delighted to report this is not my fault.  I'm only slightly less
delighted to report a fix :-) :-).

In fact, the code is there already, #ifdef'd behind a test for
CLOBBERS_TYPEAHEAD (actually, that was a bit of a giveaway).  This is
one of the old buildzsh definitions that hasn't made it into configure
yet.  The problem is that it's not that easy to test.  I've therefore
just added an ad hoc test for Ultrix to configure.in.

It would be much better to find a proper test: write a C program which
waits for a bit, then switches from canonical to non-canonical input
while a complete line was put into the input queue, and sees if the
read blocks.  (Unfortunately select() tells you there is something in
the queue, so there seems to be no way round actually trying to get a
character.  I haven't investigated what happens with a non-blocking
read().)

However, this fix is 100% vital in any case so we should certainly use
something like the following for the time being.  I wondered if it
fixed the OSF/1 problem (read() blocking on typeahead until a new key
is typed), but it didn't seem to.

By the way, there's another phantom preprocessor definition:
TTY_NEEDS_DRAINING.  Someone, somewhere may find this coming back to
haunt them.

(FIONREAD sounds extremely Gaelic.  I can't believe he's not a
relative of Finn McCumhal.)

*** config.h.in.clob	Wed May 31 05:09:34 1995
--- config.h.in	Thu Jun  8 11:18:55 1995
***************
*** 333,335 ****
--- 333,338 ----
  
  /* Define if you have the nsl library (-lnsl).  */
  #undef HAVE_LIBNSL
+ 
+ /* Define if your system's typeahead disappears from the shell editor. */
+ #undef CLOBBERS_TYPEAHEAD
*** configure.clob	Thu Jun  8 11:26:56 1995
--- configure	Thu Jun  8 11:37:18 1995
***************
*** 2321,2326 ****
--- 2321,2338 ----
  
  echo "$ac_t""$wtmp_file" 1>&6
  
+ echo $ac_n "checking if typeahead needs FIONREAD""... $ac_c" 1>&6
+ if test `echo $host_os | sed 's/^\([a-z]*\).*/\1/'` = ultrix; then
+   cat >> confdefs.h <<\EOF
+ #define CLOBBERS_TYPEAHEAD 1
+ EOF
+ 
+   zsh_cv_clobbers_typeahead=yes
+ else
+   zsh_cv_clobbers_typeahead=no
+ fi
+ echo "$ac_t""$zsh_cv_clobbers_typeahead" 1>&6
+ 
  trap '' 1 2 15
  cat > confcache <<\EOF
  # This file is a shell script that caches the results of configure
*** configure.in.clob	Wed May 31 05:09:21 1995
--- configure.in	Thu Jun  8 11:37:13 1995
***************
*** 415,420 ****
--- 415,435 ----
  AC_DEFINE_UNQUOTED(WTMP_FILE_CONFIG, "$wtmp_file")
  AC_MSG_RESULT($wtmp_file)
  
+ dnl Some systems clobber typeahead when you go from canonical input
+ dnl processing to non-canonical, so we need a FIONREAD ioctl.
+ dnl I don't know how to check this with configure, so I am using the
+ dnl system names directly.
+ dnl Note doubled square brackets for M4.
+ dnl (PWS 1995/06/08)
+ AC_MSG_CHECKING(if typeahead needs FIONREAD)
+ if test `echo $host_os | sed 's/^\([[a-z]]*\).*/\1/'` = ultrix; then
+   AC_DEFINE(CLOBBERS_TYPEAHEAD)
+   zsh_cv_clobbers_typeahead=yes
+ else
+   zsh_cv_clobbers_typeahead=no
+ fi
+ AC_MSG_RESULT($zsh_cv_clobbers_typeahead)
+ 
  AC_OUTPUT(Makefile Src/Makefile Doc/Makefile Etc/Makefile Misc/Makefile \
  Util/Makefile Functions/Makefile Startup_Files/Makefile, \
  [echo > stamp-h])

-- 
Peter Stephenson <P.Stephenson@swansea.ac.uk>  Tel: +44 1792 205678 extn. 4461
WWW:  http://python.swan.ac.uk/~pypeters/      Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: typeahead fix
  1995-06-08 11:17 Ultrix typeahead fix P.Stephenson
@ 1995-06-08 18:59 ` Richard Coleman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Coleman @ 1995-06-08 18:59 UTC (permalink / raw)
  To: zsh-workers

> In fact, the code is there already, #ifdef'd behind a test for
> CLOBBERS_TYPEAHEAD (actually, that was a bit of a giveaway).  This is
> one of the old buildzsh definitions that hasn't made it into configure
> yet.  The problem is that it's not that easy to test.  I've therefore
> just added an ad hoc test for Ultrix to configure.in.
> 
> By the way, there's another phantom preprocessor definition:
> TTY_NEEDS_DRAINING.  Someone, somewhere may find this coming back to
> haunt them.


I've looked through the configuration scripts for zsh 2.5.03 and it
defines CLOBBERS_TYPEAHEAD for ultrix and dgux.  It defines
TTY_NEEDS_DRAINING for ultrix.  People on these machines should check
whether either of these are needed.

What is the relationship/lineage between ultrix and dgux?

I've changed the patch around a little.  Test this and make sure it is
ok.

rc

*** configure.in	1995/05/23 03:50:13	1.23
--- configure.in	1995/06/08 18:36:36	1.25
***************
*** 414,419 ****
--- 414,433 ----
  done
  AC_DEFINE_UNQUOTED(WTMP_FILE_CONFIG, "$wtmp_file")
  AC_MSG_RESULT($wtmp_file)
+ 
+ dnl Some systems clobber typeahead when you go from canonical input
+ dnl processing to non-canonical, so we need a FIONREAD ioctl.
+ dnl I don't know how to check this with configure, so I am using the
+ dnl system names directly.
+ dnl The doubled square brackets are necessary because autoconf uses m4.
+ AC_MSG_CHECKING(if typeahead needs FIONREAD)
+ AC_CACHE_VAL(zsh_cv_clobbers_typeahead,
+ [test `echo $host_os | sed 's/^\([[a-z]]*\).*/\1/'` = ultrix &&
+ zsh_cv_clobbers_typeahead=yes || zsh_cv_clobbers_typeahead=no])
+ AC_MSG_RESULT($zsh_cv_clobbers_typeahead)
+ if test $zsh_cv_clobbers_typeahead = yes; then
+   AC_DEFINE(CLOBBERS_TYPEAHEAD)
+ fi
  
  AC_OUTPUT(Makefile Src/Makefile Doc/Makefile Etc/Makefile Misc/Makefile \
  Util/Makefile Functions/Makefile Startup_Files/Makefile, \


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-06-08 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-06-08 11:17 Ultrix typeahead fix P.Stephenson
1995-06-08 18:59 ` Richard Coleman

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).