Commits

Jakub Wilk  committed e18473c

Do not crash if TERM is set to wrong value.

  • Participants
  • Parent commits 3cb5d99

Comments (0)

Files changed (2)

File doc/changelog

 ydpy (0.3.2) UNRELEASED; urgency=low
 
-  * 
+  * Do not crash if TERM is set to wrong value.
 
- -- Jakub Wilk <jwilk@jwilk.net>  Sun, 09 Dec 2012 21:02:54 +0100
+ -- Jakub Wilk <jwilk@jwilk.net>  Sun, 09 Dec 2012 21:05:32 +0100
 
 ydpy (0.3.1) unstable; urgency=low
 

File lib/colorterm.py

 
 import curses
 import functools
+import os
 import re
 
 def fgcolor(i):
 CYAN = 6
 WHITE = 7
 
-curses.setupterm()
+try:
+    curses.setupterm()
+except curses.error:
+    os.putenv('TERM', 'dumb')
+    curses.setupterm()
 
 try:
     curses.tparm('x'.encode())