about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-08-21 14:34:51 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-08-21 14:34:51 +0000
commitc326bf0d30b4e0a062d661b29ef8c1e2962078a8 (patch)
tree7b2423e77489edf9e20c9647421b660423d8e080
parent58aefcada3e25ea8fe7b8dcbf820354008f7e591 (diff)
downloadzsh-c326bf0d30b4e0a062d661b29ef8c1e2962078a8.tar.gz
zsh-c326bf0d30b4e0a062d661b29ef8c1e2962078a8.tar.xz
zsh-c326bf0d30b4e0a062d661b29ef8c1e2962078a8.zip
27228: clear function for zsh-newuser-install
-rw-r--r--ChangeLog7
-rw-r--r--Functions/Newuser/zsh-newuser-install9
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9717f6edd..442bbe4cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-21  Peter Stephenson  <pws@csr.com>
+
+	* 27228: Functions/Newuser/zsh-newuser-install: add a clear
+	function if the command doesn't exist.
+
 2009-08-17  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 27219: Completion/Unix/Type/_files: "_files -F <array>" wasnʼt
@@ -12094,5 +12099,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4763 $
+* $Revision: 1.4764 $
 *****************************************************
diff --git a/Functions/Newuser/zsh-newuser-install b/Functions/Newuser/zsh-newuser-install
index 04d1aa9ca..84d68a831 100644
--- a/Functions/Newuser/zsh-newuser-install
+++ b/Functions/Newuser/zsh-newuser-install
@@ -19,6 +19,15 @@ if (( EUID == 0 || UID == 0 )); then
   return 1
 fi
 
+# clear is missing in some Cygwin configurations (lacking ncurses)
+if ! ( clear >/dev/null 2>/dev/null ); then
+  if zmodload zsh/termcap 2>/dev/null; then
+    clear() { echotc cl; }
+  else
+    clear() { print -n "\e[H\e[J"; }
+  fi
+fi
+
 # The directory in which to look for and save .zshrc.
 local zd=${ZDOTDIR:-$HOME}
 # The same directory in a user friendly form, i.e. with ~ replacement.