Skip to content

Commit 9e3c684

Browse files
committed
Fix print_banner (close #63)
1 parent 695796b commit 9e3c684

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,11 @@ def print_banner(self) -> None:
891891
if sys.platform == "win32":
892892
os.system("mode con: lines=35")
893893

894-
console_width = os.get_terminal_size().columns
894+
if sys.stdout.isatty():
895+
console_width = os.get_terminal_size().columns
896+
else:
897+
console_width = 80
898+
895899
disclaimer = """DISCLAIMER. The developer and/or supplier of this software shall not be liable for any loss or damage, including but not limited to direct, indirect, incidental, punitive or consequential damages arising out of the use of or inability to use this software, even if the developer or supplier has been advised of the possibility of such damages. The developer and/or supplier of this software shall not be liable for any legal consequences arising out of the use of this software. This includes, but is not limited to, violation of laws, rules or regulations, as well as any claims or suits arising out of the use of this software. The user is solely responsible for compliance with all applicable laws and regulations when using this software."""
896900
wrapped_text = textwrap.TextWrapper(width=70).wrap(disclaimer)
897901

0 commit comments

Comments
 (0)