Tolerate unavailable terminal clear during setup

This commit is contained in:
Nick Sweeting 2026-08-09 13:34:27 -04:00
parent 9e55d19c16
commit d9e82d9378
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -62,10 +62,10 @@ def test_setup_script_prints_root_safe_runtime_commands():
assert "--connect-timeout 1 --max-time 2" in script
def test_setup_script_does_not_clear_without_a_terminal():
def test_setup_script_does_not_fail_when_clear_cannot_use_terminal():
script = SETUP_SCRIPT.read_text()
assert "if [ -t 1 ]; then\n clear\nfi" in script
assert "if [ -t 1 ]; then\n clear || true\nfi" in script
def test_setup_script_keeps_optional_binary_probes_quiet():

View File

@ -18,7 +18,7 @@ if (set -o errtrace) 2>/dev/null; then
set -o errtrace
fi
if [ -t 1 ]; then
clear
clear || true
fi
RUNNING_AS_ROOT="false"