Subject: [sup-devel] [PATCH] try loading ncursesw

From: Rich Lane <[email-masked]>
Date: Tue, 29 Dec 2009 15:58:56 -0800

---
 bin/sup           |   14 +++++++++++++-
 lib/sup/buffer.rb |    7 ++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/bin/sup b/bin/sup
index 471e833..fcc254f 100755
--- a/bin/sup
+++ b/bin/sup
@@ -1,7 +1,15 @@
 #!/usr/bin/env ruby
 
 require 'rubygems'
-require 'ncurses'
+
+no_ncursesw = false
+begin
+  require 'ncursesw'
+rescue LoadError
+  require 'ncurses'
+  no_ncursesw = true
+end
+
 require 'curses'
 require 'fileutils'
 require 'trollop'
@@ -21,6 +29,10 @@ EOS
   exit(-1)
 end
 
+if no_ncursesw
+  warn "Install the ncursesw gem for wide character support."
+end
+
 $opts = Trollop::options do
   version "sup v#{Redwood::VERSION}"
   banner <<EOS
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index df5d23c..e5175bb 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -1,6 +1,11 @@
 require 'etc'
 require 'thread'
-require 'ncurses'
+
+begin
+  require 'ncursesw'
+rescue LoadError
+  require 'ncurses'
+end
 
 if defined? Ncurses
 module Ncurses
-- 
1.6.0.4

_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: William Morgan <[email-masked]>
Date: Thu, 31 Dec 2009 10:56:19 -0800

Applied directly to master, thanks.
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: William Morgan <[email-masked]>
Date: Thu, 31 Dec 2009 11:09:39 -0800

> Applied directly to master, thanks.

I changed it from warn to debug though, in line with the chronic
message.
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel