Set prompt escape chars only when they work

This commit is contained in:
Adam Cammack 2020-05-21 09:26:58 -05:00
parent 8de2f76476
commit 023db0c8b0
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ module Color
def substitute_colors(msg, in_prompt = nil)
str = msg.dup
pre_color = post_color = ''
if (in_prompt)
if (in_prompt && supports_color?)
pre_color = "\x01" # RL_PROMPT_START_IGNORE
post_color = "\x02" # RL_PROMPT_END_IGNORE
end