Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): fix inline_no_clear #5022

Merged
merged 7 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed flicker when setting `dark` reactive on startup https://github.com/Textualize/textual/pull/4989
- Fixed command palette not sorting search results by their match score https://github.com/Textualize/textual/pull/4994
- Fixed `DataTable` cached height issue on re-populating the table when using auto-height rows https://github.com/Textualize/textual/pull/4992
- Fixed inline app output being cleared when `inline_no_clear=True` https://github.com/Textualize/textual/issues/5019

## [0.79.1] - 2024-08-31

Expand Down
10 changes: 7 additions & 3 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2909,10 +2909,14 @@ async def invoke_ready_callback() -> None:
self._driver.write(
Control.move(-cursor_x, -cursor_y + 1).segment.text
)
if inline_no_clear and not not self.app._exit_renderables:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "not not" is a bug. I think the reasoning was that if there are errors (in the exit renderables) they should be printed rather than the last frame.

if inline_no_clear:
console = Console()
console.print(self.screen._compositor)
console.print()
try:
console.print(self.screen._compositor)
except ScreenStackError:
pass
else:
console.print()

driver.stop_application_mode()
except Exception as error:
Expand Down
Loading