Skip to content

Commit 58a0e92

Browse files
committed
🚸 Fix bad output from tabulate for powershell
1 parent 1831890 commit 58a0e92

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎simvue/utilities.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,17 @@ def parse_validation_response(
121121
break
122122
information.append(input_arg)
123123

124-
msg: str = issue["msg"]
124+
# Limit message to be 60 characters
125+
msg: str = issue["msg"][:60]
125126
information.append(msg)
126127
out.append(information)
127128

128-
_table = tabulate.tabulate(out, headers=headers, tablefmt="fancy_grid")
129+
_table_fmt: str = "simple"
130+
131+
if os.environ.get("SHELL") == "bash":
132+
_table_fmt = "fancy_grid"
133+
134+
_table = tabulate.tabulate(out, headers=headers, tablefmt=_table_fmt)
129135
return str(_table)
130136

131137

0 commit comments

Comments
 (0)