Fixed clearing the screen under live macOS

This commit is contained in:
2Shirt 2020-01-30 13:09:57 -07:00
parent 4a3981e10c
commit 417241acb5
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -728,7 +728,11 @@ def choice(choices, prompt='答えろ!'):
def clear_screen():
"""Simple wrapper for clear/cls."""
cmd = 'cls' if os.name == 'nt' else 'clear'
subprocess.run(cmd, check=False, shell=True, stderr=subprocess.PIPE)
proc = subprocess.run(cmd, check=False, shell=True, stderr=subprocess.PIPE)
# Workaround for live macOS env
if proc.returncode != 0:
print('\033c')
def color_string(strings, colors, sep=' '):