From cf7be3e1178fe95fca6373159712bbe790be94b7 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 20 May 2025 19:09:16 +0800 Subject: [PATCH] fix(tui): fix one-time output rendering on exit for TUI --- .pre-commit-config.yaml | 4 ++-- CHANGELOG.md | 2 +- nvitop/tui/screens/main/panels/process.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b0fe709..9db6394 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,9 +26,9 @@ repos: fail_fast: true - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.9 + rev: v0.11.10 hooks: - - id: ruff + - id: ruff-check args: [--fix, --exit-non-zero-on-fix] - id: ruff-format args: [--exit-non-zero-on-format] diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d7604..177a343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- +- Fix one-time output rendering on exit for TUI by [@XuehaiPan](https://github.com/XuehaiPan). ### Removed diff --git a/nvitop/tui/screens/main/panels/process.py b/nvitop/tui/screens/main/panels/process.py index 6302d39..48f13d4 100644 --- a/nvitop/tui/screens/main/panels/process.py +++ b/nvitop/tui/screens/main/panels/process.py @@ -706,7 +706,7 @@ class ProcessPanel(BaseSelectablePanel): # pylint: disable=too-many-instance-at if process.is_zombie or process.no_permissions or process.is_gone: info_segments = info.split(process.command) if not IS_SUPERUSER and process.username != USERNAME: - info_segments = [colored(item, attrs=('dark',)) for item in info] + info_segments = [colored(item, attrs=('dark',)) for item in info_segments] info = colored( process.command, color=('red' if process.is_gone else 'yellow'),