sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 44e4966c3e1190783dd86dc66e2e7dd7f357eb7f
parent 1e7fc5bc688bd7cde48e137cb81f094142630138
Author: Sharif Olorin <sio@tesser.org>
Date:   Sat, 29 Nov 2014 05:51:33 +1100

Fail fast if we know we don't have color support

The thought here is to make it clear to the user that either their
terminal or their TERM variable is the problem, rather than providing a
cryptic message about a certain color being 'unknown'.

Diffstat:
M lib/sup/colormap.rb | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/sup/colormap.rb b/lib/sup/colormap.rb
@@ -17,6 +17,9 @@ module Ncurses
 
     ## xterm 24-shade grayscale
     24.times { |x| color! "g#{x}", (16+6*6*6) + x }
+  elsif Ncurses::NUM_COLORS == -1
+    ## Terminal emulator doesn't appear to support colors
+    raise ArgumentError, "sup must be run in a terminal with color support"
   end
 end