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.
This commit is contained in:
parent
5f914901d1
commit
0e31c3a3b7
1 changed files with 3 additions and 0 deletions
|
|
@ -581,6 +581,8 @@ function startwatching(gamenumber) {
|
||||||
session.id = reply.id;
|
session.id = reply.id;
|
||||||
session.playing = false;
|
session.playing = false;
|
||||||
termemu.resize(reply.h, reply.w);
|
termemu.resize(reply.h, reply.w);
|
||||||
|
termemu.reset();
|
||||||
|
termemu.toAltBuf();
|
||||||
setTitle("Watching");
|
setTitle("Watching");
|
||||||
debug(1, "Watching with id " + session.id);
|
debug(1, "Watching with id " + session.id);
|
||||||
setmode("play");
|
setmode("play");
|
||||||
|
|
@ -644,6 +646,7 @@ function gameover() {
|
||||||
session.playing = false;
|
session.playing = false;
|
||||||
ajaxstate.clear();
|
ajaxstate.clear();
|
||||||
setTitle("Game over.");
|
setTitle("Game over.");
|
||||||
|
termemu.toNormBuf();
|
||||||
nsend = 0;
|
nsend = 0;
|
||||||
nrecv = 0;
|
nrecv = 0;
|
||||||
msgQ = [];
|
msgQ = [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue