From 7affbd9343f6f7cc14655779cbd9d47117f86cc2 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Thu, 3 Sep 2026 11:59:30 -0600 Subject: [PATCH] fix(kv): keep copy log rows single-spaced --- unshackle/commands/kv.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/unshackle/commands/kv.py b/unshackle/commands/kv.py index 5f73d4ef..00986167 100644 --- a/unshackle/commands/kv.py +++ b/unshackle/commands/kv.py @@ -6,6 +6,7 @@ from typing import Optional, Union from uuid import UUID import click +from rich.console import RenderableType from rich.padding import Padding from rich.progress import ( MofNCompleteColumn, @@ -55,6 +56,13 @@ def process_service_keys(from_vault: Vault, service: str, log: logging.Logger) - return {kid: key for kid, key in content_keys if kid not in bad_keys} +class _PaddedProgress(Progress): + """Progress bar with a blank line above it and a left indent matching log rows.""" + + def get_renderable(self) -> RenderableType: + return Padding(super().get_renderable(), (1, 0, 0, 5)) + + def add_keys_with_progress(vault: Vault, service: str, kid_keys: dict[str, str], log: logging.Logger) -> int: """Add content keys to a vault in batches, with a progress bar of counts and time left.""" @@ -65,8 +73,7 @@ def add_keys_with_progress(vault: Vault, service: str, kid_keys: dict[str, str], kids = list(kid_keys) added = 0 - console.print() - with Progress( + with _PaddedProgress( SpinnerColumn(finished_text=""), TextColumn("[bold]{task.description}"), GradientPulseBarColumn(),