diff --git a/changelog.md b/changelog.md index 130f44b1..360c27e2 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,7 @@ Bug Fixes * Let interactive changes to the prompt format respect dynamically-computed values. * Better handle arguments to `system cd`. * Fix missing keepalives in `\e` prompt loop. +* Always strip trailing newlines with `\e`. 1.56.0 (2026/02/23) diff --git a/mycli/packages/special/iocommands.py b/mycli/packages/special/iocommands.py index 96904f86..47ab3a06 100644 --- a/mycli/packages/special/iocommands.py +++ b/mycli/packages/special/iocommands.py @@ -194,7 +194,7 @@ def open_external_editor(filename: str | None = None, sql: str | None = None) -> query = f.read() except IOError: message = f'Error reading file: {filename}' - return (query, message) + return (query.rstrip('\n'), message) # Populate the editor buffer with the partial sql (if available) and a # placeholder comment.