diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-03-14 16:09:06 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-03-14 16:09:06 +1300 |
commit | bb8adfb731bc46bb02b414b59d7301e1aff552dc (patch) | |
tree | 732569a86c711bc83675c1f9b0abb0226cbee95a /libmproxy | |
parent | 974cb036314d276806bc2342aaf03de06624d206 (diff) | |
download | mitmproxy-bb8adfb731bc46bb02b414b59d7301e1aff552dc.tar.gz mitmproxy-bb8adfb731bc46bb02b414b59d7301e1aff552dc.tar.bz2 mitmproxy-bb8adfb731bc46bb02b414b59d7301e1aff552dc.zip |
Use .stop() and .start() to restart curses around external spawns.
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/console.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libmproxy/console.py b/libmproxy/console.py index 532f3c1c..f05b27e7 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -371,18 +371,15 @@ class ConnectionView(WWrap): if not c: c = "vi" cmd = [c, name] + self.master.ui.stop() try: ret = subprocess.call(cmd) except: self.master.statusbar.message("Can't start editor: %s" % c) - self.master.ui._curs_set(1) - self.master.ui.clear() + self.master.ui.start() os.unlink(name) return data - # Not sure why, unless we do this we get a visible cursor after - # spawning 'less'. - self.master.ui._curs_set(1) - self.master.ui.clear() + self.master.ui.start() data = open(name).read() os.unlink(name) return data @@ -947,11 +944,9 @@ class ConsoleMaster(flow.FlowMaster): if not cmd: c = os.environ.get("PAGER") or os.environ.get("EDITOR") cmd = [c, name] + self.ui.stop() ret = subprocess.call(cmd, shell=shell) - # Not sure why, unless we do this we get a visible cursor after - # spawning 'less'. - self.ui._curs_set(1) - self.ui.clear() + self.ui.start() os.unlink(name) def set_palette(self): |