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

Re: Cygwin New User Issue?



On Wed, 19 Aug 2009 09:03:26 +0800
Aaron Davies <aaron.davies@xxxxxxxxx> wrote:
> Specific to cygwin, I should also note that the default install has no  
> "clear" command included (they've packaged that with ncurses), so zsh- 
> newuser-install also throws several "command not found: clear" errors.

This should cover most bases.

Index: Functions/Newuser/zsh-newuser-install
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Newuser/zsh-newuser-install,v
retrieving revision 1.7
diff -u -r1.7 zsh-newuser-install
--- Functions/Newuser/zsh-newuser-install	17 Aug 2009 11:15:38 -0000	1.7
+++ Functions/Newuser/zsh-newuser-install	21 Aug 2009 14:25:18 -0000
@@ -19,6 +19,15 @@
   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.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


'member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom'



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