about summary refs log tree commit diff
path: root/saneterm
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2021-05-22 05:27:08 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2021-05-22 05:27:08 +0200
commite3217333532c16f1586defe33fce52cd447c7388 (patch)
tree4c2947a10de92cd56ab18993081b302e26f63e02 /saneterm
parentee9c3bcf6f411756dfe302c19ef9a7a31abc12a3 (diff)
terminal: Add support for VEOF
Diffstat (limited to 'saneterm')
-rw-r--r--saneterm/terminal.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/saneterm/terminal.py b/saneterm/terminal.py
index eb4fca8..075eddd 100644
--- a/saneterm/terminal.py
+++ b/saneterm/terminal.py
@@ -21,6 +21,7 @@ TERM = "dumb"
 control_keys = {
     "<ctrl>c": termios.VINTR,
     "<ctrl>z": termios.VSUSP,
+    "<ctrl>d": termios.VEOF,
 }
 
 class PtySource(GLib.Source):
@@ -101,6 +102,9 @@ class Terminal(Gtk.Window):
         os.write(self.pty.master, line.encode("UTF-8"))
 
     def termios_ctrl(self, termview, cidx):
+        if cidx == termios.VEOF:
+            termview.flush()
+
         # TODO: Employ some heuristic to cache tcgetattr result.
         cc = termios.tcgetattr(self.pty.master)[-1]
         os.write(self.pty.master, cc[cidx])