From 4dd8915312aead1a34edc77a55f5c61fb90e9e61 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Wed, 30 Dec 2015 00:52:54 +0000 Subject: [PATCH] Fix program crashing when LS_COLORS environment variable doesn't exist. Now using the default colors, but they're not quite right yet... --- tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools.py b/tools.py index ccffd7d..4614d22 100644 --- a/tools.py +++ b/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])