Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9db7236
Stage 3: choose between reserved and legacy toolbar rendering
tleonhardt Sep 10, 2026
4d9cb58
Stage 3: own the reservation and its bindings for one command loop
tleonhardt Sep 10, 2026
3025372
Stage 3: hide the native toolbar window and paint the band instead
tleonhardt Sep 10, 2026
5210e85
Stage 3: choose the mode and own the toolbar for the command loop
tleonhardt Sep 10, 2026
c253de5
Stage 3 review: roll back a failed startup, and restore only what is …
tleonhardt Sep 10, 2026
d1ef338
Stage 3 review: put the terminal back after a half-written paint
tleonhardt Sep 10, 2026
411b124
Stage 3 review: only restore a cursor this paint actually saved
tleonhardt Sep 10, 2026
4071b6c
Stage 3: treat the cursor as unknown after a failed paint, and fall b…
tleonhardt Sep 10, 2026
c3a8c34
Stage 3: write command output through the terminal transaction
tleonhardt Sep 10, 2026
db9b04d
Stage 3: install the serializer for commands running under a reservation
tleonhardt Sep 10, 2026
dd9ec8c
Stage 3 review: invalidate after a failed write, and decide the desti…
tleonhardt Sep 10, 2026
7c4a664
Stage 3: route the application's own renders through the bridge
tleonhardt Sep 10, 2026
5c08606
Stage 3 review: release before falling back, and invalidate on the fa…
tleonhardt Sep 10, 2026
b01eeab
Stage 3 review: route the real abandonment through the owner, and mar…
tleonhardt Sep 10, 2026
ea8aaa9
Stage 3: separate pausing the display from giving the terminal away
tleonhardt Sep 10, 2026
6059956
Stage 3 review: stop the display in serialized mode, and forget what …
tleonhardt Sep 10, 2026
991f9a9
Stage 3 review: only the outermost suspension takes the rows back
tleonhardt Sep 10, 2026
bc3adad
Stage 3: route cursor reports through the bridge, and paint on commit…
tleonhardt Sep 10, 2026
471095d
Stage 3 review: keep the main prompt inside the reservation, and gate…
tleonhardt Sep 10, 2026
5fac73e
Stage 3 review: bound the display's teardown, not just the wait for it
tleonhardt Sep 10, 2026
aaccfcb
Stage 3 review: a pause that timed out relinquished nothing, and now …
tleonhardt Sep 10, 2026
aab9e23
Stage 3 review: refuse the terminal while a display that would not st…
tleonhardt Sep 10, 2026
c9a5abe
Stage 3 review: finish the deferred teardown before letting go of the…
tleonhardt Sep 10, 2026
21a0041
Stage 3: cover the command loop's own lifetime
tleonhardt Sep 10, 2026
8e70d3c
Fix two test-only failures CI found and this machine could not
tleonhardt Sep 10, 2026
8f745a2
Stage 3 review: an unbound bridge passes calls through instead of bre…
tleonhardt Sep 10, 2026
1a6a556
Stage 3 review: clear passes through when unbound, like the rest
tleonhardt Sep 10, 2026
290e9bc
Make the toolbar modes a StrEnum instead of loose strings
tleonhardt Sep 11, 2026
d36e36b
Fix the docs build the toolbar mode page broke
tleonhardt Sep 11, 2026
1c934de
Merge reserved_row_toolbar into stage3-lifecycle-integration
tleonhardt Sep 11, 2026
61d2969
Consolidate toolbar enablement into ToolbarMode and speed up lifecycl…
tleonhardt Sep 11, 2026
cb61617
Speed up toolbar tests with explicit synchronization
tleonhardt Sep 11, 2026
2621908
Reduce pager and subprocess test overhead
tleonhardt Sep 11, 2026
a734941
Fix reserved toolbar corruption at the terminal bottom
tleonhardt Sep 11, 2026
ec1cb98
Fix intermittent toolbar refresh assertion on Windows
tleonhardt Sep 11, 2026
de5cf49
Show reserved toolbar truncation and clip lines without wrapping
tleonhardt Sep 11, 2026
2184b71
Mark reserved toolbar truncation only for visible content, and show c…
tleonhardt Sep 11, 2026
5f640c1
Merge branch 'reserved_row_toolbar' into stage3-lifecycle-integration
tleonhardt Sep 12, 2026
08c7355
Establish the prompt origin natively on Windows, and fall back instea…
tleonhardt Sep 12, 2026
f3e8009
Give the corrupt-history tests their own temp files
tleonhardt Sep 12, 2026
61e7fd9
Fix reserved toolbar resize and partial-output redraws
tleonhardt Sep 12, 2026
ef04db1
Render the built-in pager in reserved toolbar mode
tleonhardt Sep 12, 2026
32f48d2
Fix partial-output loss at shutdown and two resize lifecycle defects
tleonhardt Sep 12, 2026
974290b
Clear suppression when inactive and preserve output across resize
tleonhardt Sep 12, 2026
98e62d5
Move displaced output out of the band when a resize shrinks onto it
tleonhardt Sep 12, 2026
756dbbb
Fixed a few edge-case bugs
tleonhardt Sep 12, 2026
1fe8bc1
Address five review findings on the edge-case fixes
tleonhardt Sep 12, 2026
33647c9
Keep the fallback layout when the pager closes
tleonhardt Sep 12, 2026
690c38e
Harden the pager's exit and the fallback under an open pager
tleonhardt Sep 12, 2026
e1b04c3
Fix the reserved-to-legacy fallback during paging on a console-less t…
tleonhardt Sep 12, 2026
bc69f36
Restore command display state after pager exit failures
tleonhardt Sep 12, 2026
e219606
Wait for completed resize redraws in terminal tests
tleonhardt Sep 12, 2026
0c8c09f
Preserve Windows VT processing for serialized command output
tleonhardt Sep 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Give the corrupt-history tests their own temp files
test_history_file_bad_compression and test_history_file_bad_json wrote to
a fixed /tmp/doesntmatter, which on the Windows runner is D:\tmp and does
not exist on a fresh machine. They passed only when the preceding
permission-error test had already run: mocking builtins.open there does not
stop the history setup from creating the file's parent directory, so that
test created D:\tmp as a side effect. Under xdist the order is not fixed,
and adding tests elsewhere shifted the schedule so both writers reached a
worker first and failed on every Windows job.

All three tests now use tmp_path, so none depends on a directory existing
or on another test having run. Each passes alone on a single worker.

Validation: 2587 passed, 6 skipped with coverage; make check, make test,
make docs-test and git diff --check passed.
  • Loading branch information
tleonhardt committed Sep 12, 2026
commit f3e8009eceef2f138709740195268df31f0f150a
25 changes: 13 additions & 12 deletions tests/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,38 +910,39 @@ def test_history_cannot_create_directory(mocker, capsys) -> None:
assert "Error creating persistent history file directory" in err


def test_history_file_permission_error(mocker, capsys) -> None:
def test_history_file_permission_error(mocker, capsys, tmp_path) -> None:
mock_open = mocker.patch("builtins.open")
mock_open.side_effect = PermissionError

cmd2.Cmd(persistent_history_file="/tmp/doesntmatter")
# A path under tmp_path rather than a fixed one: mocking open() does not stop the
# history setup from creating the file's parent directory, and a fixed path would leave
# that directory behind as a side effect other tests could come to depend on.
cmd2.Cmd(persistent_history_file=str(tmp_path / "doesntmatter"))
out, err = capsys.readouterr()
assert not out
assert "Cannot read persistent history file" in err


def test_history_file_bad_compression(mocker, capsys) -> None:
history_file = "/tmp/doesntmatter"
with open(history_file, "wb") as f:
f.write(b"THIS IS NOT COMPRESSED DATA")
def test_history_file_bad_compression(capsys, tmp_path) -> None:
history_file = tmp_path / "doesntmatter"
history_file.write_bytes(b"THIS IS NOT COMPRESSED DATA")

cmd2.Cmd(persistent_history_file=history_file)
cmd2.Cmd(persistent_history_file=str(history_file))
out, err = capsys.readouterr()
assert not out
assert "Error decompressing persistent history data" in err


def test_history_file_bad_json(mocker, capsys) -> None:
def test_history_file_bad_json(capsys, tmp_path) -> None:
import lzma

data = b"THIS IS NOT JSON"
compressed_data = lzma.compress(data)

history_file = "/tmp/doesntmatter"
with open(history_file, "wb") as f:
f.write(compressed_data)
history_file = tmp_path / "doesntmatter"
history_file.write_bytes(compressed_data)

cmd2.Cmd(persistent_history_file=history_file)
cmd2.Cmd(persistent_history_file=str(history_file))
out, err = capsys.readouterr()
assert not out
assert "Error processing persistent history data" in err
Expand Down