about summary refs log tree commit diff
diff options
context:
space:
mode:
-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])