From 05c9a4fa2756c0713e5dc56a69531cdadb4f411d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 16 Sep 2014 00:26:01 -0400 Subject: use the updated metadata escape (see App::Termcast 0.13) --- termcast.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/termcast.py b/termcast.py index c86a9af..23c4b62 100644 --- a/termcast.py +++ b/termcast.py @@ -5,7 +5,7 @@ import re import vt100 auth_re = re.compile(b'^hello ([^ ]+) ([^ ]+)$') -extra_data_re = re.compile(b'\033\[H(\000([^\377]*)\377)\033\[H\033\[2J') +extra_data_re = re.compile(b'\033\]499;([^\007]*)\007') class Handler(object): def __init__(self, rows, cols): @@ -27,9 +27,9 @@ class Handler(object): m = extra_data_re.search(data) if m is None: break - extra_data_json = m.group(2) + extra_data_json = m.group(1) extra_data = json.loads(extra_data_json.decode('utf-8')) - data = data[:m.start(1)] + data[m.end(1):] + data = data[:m.start(0)] + data[m.end(0):] if "geometry" in extra_data: self.rows = extra_data["geometry"][1] self.cols = extra_data["geometry"][0] @@ -123,7 +123,7 @@ class Connection(object): extra_data = {} m = extra_data_re.match(buf) if m is not None: - extra_data_json = m.group(2) + extra_data_json = m.group(1) extra_data = json.loads(extra_data_json.decode('utf-8')) buf = buf[len(m.group(0)):] -- cgit v1.2.3-54-g00ecf