mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
Merge pull request #1538 from xonsh/fix_color_indexes
Fix color indexes on Windows
This commit is contained in:
commit
bd9d77140e
2 changed files with 18 additions and 1 deletions
14
news/fix_get_color_index.rst
Normal file
14
news/fix_get_color_index.rst
Normal file
|
@ -0,0 +1,14 @@
|
|||
**Added:** None
|
||||
|
||||
**Changed:** None
|
||||
|
||||
**Deprecated:** None
|
||||
|
||||
**Removed:** None
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Fix a startup problem on windows caused by a refactor of Prompt_toolkit.
|
||||
https://github.com/jonathanslenders/python-prompt-toolkit/commit/a9df2a2
|
||||
|
||||
**Security:** None
|
|
@ -1271,7 +1271,10 @@ def _get_color_indexes(style_map):
|
|||
for token in style_map:
|
||||
attr = pt_style.token_to_attrs[token]
|
||||
if attr.color is not None:
|
||||
index = table.lookup_color(attr.color, attr.bgcolor)
|
||||
try:
|
||||
index = table.lookup_color(attr.color, attr.bgcolor)
|
||||
except AttributeError:
|
||||
index = table.lookup_fg_color(attr.color)
|
||||
try:
|
||||
rgb = (int(attr.color[0:2], 16),
|
||||
int(attr.color[2:4], 16),
|
||||
|
|
Loading…
Add table
Reference in a new issue