about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2021-06-01 15:20:20 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2021-06-01 15:20:20 +0200
commit15448192c2b905a43c8b009ffeca0d6fc74fb639 (patch)
tree143c77771abd09e7637fc3571fc56016dedcdfb4
parent9fd935364b6026dda89f597e7e860a7042c807ce (diff)
termview: update _last_mark even on newline
Most REPLs will write a new prompt on newline but when starting a
graphical application from a shell (e.g. gitk) no output will be written
to the PTY after the newline. This causes _last_mark to not be updated
and causes cursor_at_end to always return False making it impossible to
quit the application using termios.VINTR.
-rw-r--r--saneterm/termview.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/saneterm/termview.py b/saneterm/termview.py
index d7a2618..27c9103 100644
--- a/saneterm/termview.py
+++ b/saneterm/termview.py
@@ -144,8 +144,7 @@ class TermView(Gtk.TextView):
         text = buffer.get_text(start, end, True)
         if len(text) != 0 and text[-1] == "\n":
             self.flush()
-        else:
-            self._last_mark = buffer.create_mark(None, end, True)
+        self._last_mark = buffer.create_mark(None, end, True)
 
         # User entered new text → reset tab completion state machine
         self._tabcomp.reset()