about summary refs log tree commit diff
path: root/saneterm/pty.py
diff options
context:
space:
mode:
Diffstat (limited to 'saneterm/pty.py')
-rw-r--r--saneterm/pty.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/saneterm/pty.py b/saneterm/pty.py
index 90bcf34..d294770 100644
--- a/saneterm/pty.py
+++ b/saneterm/pty.py
@@ -42,6 +42,8 @@ class Source(GLib.Source):
 class EventType(Enum):
     TEXT = auto()
     BELL = auto()
+    CARRIAGE_RETURN = auto()
+    NEWLINE = auto()
 
 class Parser(object):
     """
@@ -96,6 +98,12 @@ class Parser(object):
             if code == '\a':
                 flush_until = pos
                 special_ev = (EventType.BELL, None)
+            elif code == '\n':
+                flush_until = pos
+                special_ev = (EventType.NEWLINE, None)
+            elif code == '\r':
+                flush_until = pos
+                special_ev = (EventType.CARRIAGE_RETURN, None)
 
             pos += 1