From 417241acb51428c7ac8d5f7c0f57263a6a063973 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 30 Jan 2020 13:09:57 -0700 Subject: [PATCH] Fixed clearing the screen under live macOS --- scripts/wk/std.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/wk/std.py b/scripts/wk/std.py index 60c110f9..b25b7b9f 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -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=' '):