diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | cmd2/ansi.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 49952975..b1a49caf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## 2.3.4 (TBD, 2021) +* Bug Fixes + * Fixed issue in `ansi.async_alert_str()` which would raise `IndexError` if prompt was blank. * Enhancements * Added broader exception handling when enabling clipboard functionality via `pyperclip`. 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. |