From cddab1799a791767c0195a3d5e0584bc5883170c Mon Sep 17 00:00:00 2001 From: Justin Ho Date: Mon, 2 May 2022 10:55:56 -0700 Subject: [PATCH] Fix Windows table output formatting (#4989) --- awscli/formatter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awscli/formatter.py b/awscli/formatter.py index 5a813b861c4a..7ffe9a597ef6 100644 --- a/awscli/formatter.py +++ b/awscli/formatter.py @@ -21,7 +21,7 @@ from awscli.table import MultiTable, Styler, ColorizedStyler from awscli import text from awscli import compat -from awscli.utils import json_encoder +from awscli.utils import is_a_tty, json_encoder LOG = logging.getLogger(__name__) @@ -71,7 +71,7 @@ def _flush_stream(self, stream): class FullyBufferedFormatter(Formatter): def __call__(self, command_name, response, stream=None): - if stream is None: + if stream is None or is_a_tty(): # Retrieve stdout on invocation instead of at import time # so that if anything wraps stdout we'll pick up those changes # (specifically colorama on windows wraps stdout).