diff --git a/docs/changelog.rst b/docs/changelog.rst index cf11e1acf..c3742eb2d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -49,6 +49,9 @@ To update |kitty|, :doc:`follow the instructions `. - ssh kitten: Make argument parsing more like ssh (:iss:`1787`) +- When using :opt:`strip_trailing_spaces` do not remove empty lines + (:iss:`1802`) + 0.14.2 [2019-06-09] --------------------- diff --git a/kitty/window.py b/kitty/window.py index ddd1d5df3..4ad4f3d57 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -469,7 +469,7 @@ class Window: lines = self.screen.text_for_selection() if self.opts.strip_trailing_spaces == 'always' or ( self.opts.strip_trailing_spaces == 'smart' and not self.screen.is_rectangle_select()): - lines = [l.rstrip() for l in lines] + lines = ((l.rstrip() or '\n') for l in lines) return ''.join(lines) def destroy(self):