From 0e31c3a3b723b41cf7c8bf691ddb667a34dde905 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Tue, 19 Jun 2012 20:08:05 -0700 Subject: [PATCH] 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. --- rlgterm.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rlgterm.js b/rlgterm.js index 1b50b36..6140b4d 100644 --- a/rlgterm.js +++ b/rlgterm.js @@ -581,6 +581,8 @@ function startwatching(gamenumber) { 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 @@ function gameover() { session.playing = false; ajaxstate.clear(); setTitle("Game over."); + termemu.toNormBuf(); nsend = 0; nrecv = 0; msgQ = [];