sequences: Fix broken sequence on macOS.

This commit is contained in:
Dylan Araps 2018-06-21 08:19:01 +10:00
parent 55116a4834
commit 01356561c6

View File

@ -22,8 +22,8 @@ def set_special(index, color, iterm_name="h", alpha=100):
def set_color(index, color): def set_color(index, color):
"""Convert a hex color to a text color sequence.""" """Convert a hex color to a text color sequence."""
if OS == "Darwin": if OS == "Darwin" and index < 20:
return "\033]P%x%s\033\\" % (index, color.strip("#")) return "\033]P%1x%s\033\\" % (index, color.strip("#"))
return "\033]4;%s;%s\033\\" % (index, color) return "\033]4;%s;%s\033\\" % (index, color)