diff --git a/CHANGELOG.md b/CHANGELOG.md index e429af4..cde5dda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Bug Fixes - Expand `~` in configured log file paths before opening the log. +- Stop truncating long string values in table output. ### Internal diff --git a/litecli/main.py b/litecli/main.py index fa732c3..f4f058c 100644 --- a/litecli/main.py +++ b/litecli/main.py @@ -845,6 +845,7 @@ def format_output(self, title: Any, cur: Any, headers: Any, expanded: bool = Fal output_kwargs = { "dialect": "unix", "disable_numparse": True, + "max_field_width": None, "preserve_whitespace": True, "preprocessors": (preprocessors.align_decimals,), "style": self.output_style, diff --git a/tests/test_main.py b/tests/test_main.py index 21ad5b6..96759c2 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -244,6 +244,16 @@ def stub_terminal_size(fallback=(80, 24)): assert isinstance(lc.get_reserved_space(), int) +def test_format_output_does_not_truncate_long_strings(): + long_value = "x" * 600 + lc = LiteCli(liteclirc=default_config_file) + + output = "\n".join(lc.format_output(None, [(long_value,)], ["value"])) + + assert long_value in output + assert "..." not in output + + @dbtest def test_import_command(executor): data_file = os.path.join(project_dir, "tests", "data", "import_data.csv")