mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
color: ignore effects missing from terminfo
If terminfo mode is in effect, and an effect is used which is missing from the terminfo database, simply silently ignore the request, leaving the output unaffected rather than causing a crash.
This commit is contained in:
parent
fb575a9782
commit
36e57eb638
@ -378,7 +378,10 @@ def _effect_str(effect):
|
|||||||
if effect.endswith('_background'):
|
if effect.endswith('_background'):
|
||||||
bg = True
|
bg = True
|
||||||
effect = effect[:-11]
|
effect = effect[:-11]
|
||||||
|
try:
|
||||||
attr, val, termcode = _terminfo_params[effect]
|
attr, val, termcode = _terminfo_params[effect]
|
||||||
|
except KeyError:
|
||||||
|
return ''
|
||||||
if attr:
|
if attr:
|
||||||
if termcode:
|
if termcode:
|
||||||
return termcode
|
return termcode
|
||||||
|
Loading…
Reference in New Issue
Block a user