From: Orakaro Date: Thu, 21 Nov 2019 09:37:15 +0000 (+0900) Subject: Using escape for colored raw_input to avoid wrong calculation on readline X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=09bac3e4a3dfc64c38fd6b0267e0a82864e10b05;p=rainbowstream.git Using escape for colored raw_input to avoid wrong calculation on readline Still don't know why colors is ignored in Python 3.7.4 --- diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 02bd2a9..c42437b 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -1493,7 +1493,7 @@ def theme(): # Redefine decorated_name g['decorated_name'] = lambda x: color_func( c['DECORATED_NAME'])( - '[' + x + ']: ') + '[' + x + ']: ', rl=True) printNicely(green('Theme changed.')) except: printNicely(red('No such theme exists.')) @@ -1556,7 +1556,7 @@ def config(): if key == 'THEME': c['THEME'] = reload_theme(value, c['THEME']) g['decorated_name'] = lambda x: color_func( - c['DECORATED_NAME'])('[' + x + ']: ') + c['DECORATED_NAME'])('[' + x + ']: ', rl=True) elif key == 'PREFIX': g['PREFIX'] = u2str(emojize(format_prefix( listname=g['listname'],