summaryrefslogtreecommitdiff
path: root/cmd2/ansi.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2022-01-12 14:40:53 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2022-01-12 14:40:53 -0500
commitef83f1dbe9389b3ebe001cd8f43c8e9fcfc5079e (patch)
treeb8f6c1d529379ba836879dd1406c9bc323618b5d /cmd2/ansi.py
parentc1f6114d52161a3b8a32d3cee1c495d79052e1fb (diff)
downloadcmd2-git-blank_prompt.tar.gz
Fixed issue in ansi.async_alert_str() which would raise IndexError if prompt was blank.blank_prompt
Diffstat (limited to 'cmd2/ansi.py')
-rw-r--r--cmd2/ansi.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd2/ansi.py b/cmd2/ansi.py
index 29d09fff..fba6e050 100644
--- a/cmd2/ansi.py
+++ b/cmd2/ansi.py
@@ -1046,7 +1046,7 @@ def async_alert_str(*, terminal_columns: int, prompt: str, line: str, cursor_off
"""
# Split the prompt lines since it can contain newline characters.
- prompt_lines = prompt.splitlines()
+ prompt_lines = prompt.splitlines() or ['']
# Calculate how many terminal lines are taken up by all prompt lines except for the last one.
# That will be included in the input lines calculations since that is where the cursor is.