changeset 61:071ec6b1ec03

RLG-Web client: initialize and restore the terminal when watching. Since watchers might not get the curses initialization and ending sequences, the terminal emulator needs to be set up for and restored after watching.
author John "Elwin" Edwards <elwin@sdf.org>
date Tue, 19 Jun 2012 20:08:05 -0700
parents 31bb3cf4f25f
children 7793ad53b90f
files rlgterm.js
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rlgterm.js	Tue Jun 19 19:11:59 2012 -0700
+++ b/rlgterm.js	Tue Jun 19 20:08:05 2012 -0700
@@ -581,6 +581,8 @@
       session.id = reply.id;
       session.playing = false;
       termemu.resize(reply.h, reply.w);
+      termemu.reset();
+      termemu.toAltBuf();
       setTitle("Watching");
       debug(1, "Watching with id " + session.id);
       setmode("play");
@@ -644,6 +646,7 @@
   session.playing = false;
   ajaxstate.clear();
   setTitle("Game over.");
+  termemu.toNormBuf();
   nsend = 0;
   nrecv = 0;
   msgQ = [];