summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-07-01 00:34:07 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2019-07-01 00:34:07 -0400
commit031f2626e63708e4a7334826167a97d56fa29fdb (patch)
treed2ae15a9f8427b785e86d99b529fd98d12e7188a /cmd2/cmd2.py
parent0bcd2905177bfd62c51c9181926869c9ec2deb0d (diff)
downloadcmd2-git-031f2626e63708e4a7334826167a97d56fa29fdb.tar.gz
Modified async_alert_str to also get passed the number of terminal columns and added unit tests for it
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 7efa6849..a10219b1 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -3830,7 +3830,9 @@ class Cmd(cmd.Cmd):
update_terminal = True
if update_terminal:
- terminal_str = ansi.async_alert_str(prompt=current_prompt, line=readline.get_line_buffer(),
+ import shutil
+ terminal_str = ansi.async_alert_str(terminal_columns=shutil.get_terminal_size().columns,
+ prompt=current_prompt, line=readline.get_line_buffer(),
cursor_offset=rl_get_point(), alert_msg=alert_msg)
if rl_type == RlType.GNU:
sys.stderr.write(terminal_str)