Skip to content

Commit

Permalink
Merge pull request #5022 from TomJGooding/fix-app-fix-inline-no-clear
Browse files Browse the repository at this point in the history
fix(app): fix `inline_no_clear`
  • Loading branch information
willmcgugan authored Sep 23, 2024
2 parents 8b8c10d + 23844b1 commit d103e5f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 69 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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
14 changes: 11 additions & 3 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2959,10 +2959,18 @@ 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:
if inline_no_clear and not self.app._exit_renderables:
console = Console()
console.print(self.screen._compositor)
console.print()
try:
console.print(self.screen._compositor)
except ScreenStackError:
console.print()
else:
self._driver.write(
Control.move(
-cursor_x, -self.INLINE_PADDING - 1
).segment.text
)

driver.stop_application_mode()
except Exception as error:
Expand Down
4 changes: 2 additions & 2 deletions src/textual/drivers/linux_inline_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ def stop_application_mode(self) -> None:
"""Stop application mode, restore state."""
self._disable_bracketed_paste()
self.disable_input()

self.write("\x1b[2A\x1b[J")
self.write("\x1b[<u") # Disable kitty protocol
self.write("\x1b[J")

if self.attrs_before is not None:
try:
Expand Down
Loading

0 comments on commit d103e5f

Please sign in to comment.