about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-10-30 11:03:13 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-10-30 11:03:13 +0000
commit12a38ba4f725e423e9f5ab4c87af7fc03663b90e (patch)
tree830cf0af50dbe664c25a5651718e3a6a25bae665
parenta6d9b3b83556d96d6c58b0163722d3582d8446e5 (diff)
downloadzsh-12a38ba4f725e423e9f5ab4c87af7fc03663b90e.tar.gz
zsh-12a38ba4f725e423e9f5ab4c87af7fc03663b90e.tar.xz
zsh-12a38ba4f725e423e9f5ab4c87af7fc03663b90e.zip
adapted 24030: work around Solaris cancelling curses key timeout
-rw-r--r--ChangeLog7
-rw-r--r--Src/Modules/curses.c12
2 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c71eda56..cf9096faa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-30  Peter Stephenson  <pws@csr.com>
+
+	* 24030, adapted: Src/Modules/curses.c: turning off a key timeout
+	on Solaris 8 seemed to need leaving and re-entering cbreak mode.
+	This can't be done per-window, so make this specific to Solaris
+	not using ncurses.
+
 2007-10-29  Clint Adams  <clint@zsh.org>
 
 	* Markus Waldeck: 24032 (tweaked): Completion/Unix/Command/_cut:
diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c
index a1801e913..ae8859726 100644
--- a/Src/Modules/curses.c
+++ b/Src/Modules/curses.c
@@ -961,6 +961,18 @@ zccmd_timeout(const char *nam, char **args)
 	return 1;
     }
 
+#if defined(__sun__) && defined(__SVR4) && !defined(HAVE_USE_DEFAULT_COLORS)
+    /*
+     * On Solaris turning a timeout off seems to be problematic.
+     * The following fixes it.  We test for Solaris without ncurses
+     * (the last test) to be specific; this may turn up in other older
+     * versions of curses, but it's difficult to test for.
+     */
+    if (to < 0) {
+	nocbreak();
+	cbreak();
+    }
+#endif
     wtimeout(w->win, to);
     return 0;
 }