export: Fix bug with color66 appearing in export files. Closes #6

This commit is contained in:
Dylan Araps 2017-06-26 10:14:32 +10:00
parent 670c352872
commit bd8ae8ffc8
2 changed files with 7 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
dist/* dist/*
pywal.egg-info/* pywal.egg-info/*
*.pyc

View File

@ -272,6 +272,11 @@ def set_special(index, color):
ColorType.xrdb.append(f"URxvt*cursorColor: {color}") ColorType.xrdb.append(f"URxvt*cursorColor: {color}")
ColorType.xrdb.append(f"XTerm*cursorColor: {color}") ColorType.xrdb.append(f"XTerm*cursorColor: {color}")
elif index == 66:
ColorType.xrdb.append(f"*.color{index}: {color}")
ColorType.xrdb.append(f"*color{index}: {color}")
ColorType.sequences.append(f"\\033]4;{index};{color}\\007")
def set_color(index, color): def set_color(index, color):
"""Build the escape sequence we need for each color.""" """Build the escape sequence we need for each color."""
@ -319,7 +324,7 @@ def send_sequences(colors, vte):
[set_color(num, color) for num, color in enumerate(colors)] [set_color(num, color) for num, color in enumerate(colors)]
# Set a blank color that isn"t affected by bold highlighting. # Set a blank color that isn"t affected by bold highlighting.
set_color(66, colors[0]) set_special(66, colors[0])
# Make the terminal interpret escape sequences. # Make the terminal interpret escape sequences.
sequences = fix_escape("".join(ColorType.sequences)) sequences = fix_escape("".join(ColorType.sequences))