From 108843f89e4a4d2ec21a3742fccdb9b180e5dc96 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 2 Sep 2021 21:18:31 +0000 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).