Occasionally when connected to a Linux machine using Windows 10's native
ssh client, the screen doesn't get cleared between two attempts to draw
the screen. This seems to be due to the clear process writing the
control codes to its own copy of standard out, which isn't doesn't seem
to flushed to the screen at the same time as Python writes out the menu.
This patch causes Python to capture the control codes used by clear,
and writes them to the script's own standard output.
On Windows, the same trick doesn't work (Python writes '\f'/'\x0c',
which displays as ♀/'\u2640', see en.wikipedia.org/wiki/Code_page_437).
Instead, this patch continues to just call cls, but uses 'subprocess'
for consistency.
Occasionally when connected to a Linux machine using Windows 10's native ssh client, the screen doesn't get cleared between two attempts to draw the screen. This seems to be due to the
clear
process writing the control codes to its own copy of standard out, which isn't doesn't seem to flushed to the screen at the same time as Python writes out the menu.This patch causes Python to capture the control codes used by
clear
, and writes them to the script's own standard output.On Windows, the same trick doesn't work (Python writes '\f'/'\x0c', which displays as ♀/'\u2640', see en.wikipedia.org/wiki/Code_page_437). Instead, this patch continues to just call
cls
, but uses 'subprocess' for consistency.