Fix program crashing when LS_COLORS environment variable doesn't exist.
Now using the default colors, but they're not quite right yet...
This commit is contained in:
parent
da280ea9b2
commit
4dd8915312
1 changed files with 3 additions and 0 deletions
3
tools.py
3
tools.py
|
|
@ -586,6 +586,9 @@ def _convert_lscolor_code_to_charstyle(lscolor_code):
|
|||
if len(parts) == 1:
|
||||
is_bold = parts[0] == "1"
|
||||
fg_color = None
|
||||
elif len(parts) == 2:
|
||||
is_bold = False
|
||||
fg_color = int(parts[1])
|
||||
else:
|
||||
is_bold = len(parts) == 4 and parts[3] == "1"
|
||||
fg_color = int(parts[2])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue