lower interactive shell history to conserve context; improve prompts

This commit is contained in:
AI Christianson 2025-02-12 15:26:48 -05:00
parent 94f0d96654
commit c9d7e90312
1 changed files with 7 additions and 7 deletions

View File

@ -62,7 +62,7 @@ def test_interactive_command():
def test_large_output():
"""Test handling of commands that produce large output."""
# Generate a large output with predictable content
cmd = 'for i in {1..10000}; do echo "Line $i of test output"; done'
cmd = 'for i in {1..3000}; do echo "Line $i of test output"; done'
output, retcode = run_interactive_command(["/bin/bash", "-c", cmd])
# Clean up specific artifacts (e.g., ^D)
@ -75,13 +75,13 @@ def test_large_output():
if b"Script" not in line and line.strip()
]
# Verify we got all 10000 lines
assert len(lines) == 10000, f"Expected 10000 lines, but got {len(lines)}"
# We expect around 2000 lines plus some additional lines from the current display
# The exact number may vary slightly due to terminal buffering, but should be close to 2024
# (2000 history lines + 24 terminal lines)
assert 2000 <= len(lines) <= 2050, f"Expected between 2000-2050 lines due to history limit plus terminal display, but got {len(lines)}"
# Verify content of some lines
assert lines[0] == b"Line 1 of test output", f"Unexpected line: {lines[0]}"
assert lines[999] == b"Line 1000 of test output", f"Unexpected line: {lines[999]}"
assert lines[-1] == b"Line 10000 of test output", f"Unexpected line: {lines[-1]}"
# Verify that we have the last lines (should include line 3000)
assert lines[-1] == b"Line 3000 of test output", f"Unexpected last line: {lines[-1]}"
# Verify return code
assert retcode == 0, f"Unexpected return code: {retcode}"