Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion cmd2/ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down