anchor.diff:        socket.close();
         socket = null;
       }
  -    destroyRepl()
  +    destroyRepl(term)
         .then(() => createRepl(term))
         .then(() => { socket = new SocketMonitor(socketURL, term); })
         .then(() => term.writeln('Ready...'));
  
positive.code:   const replURL = 'http://' + location.hostname + '/repl/' + urlId;
    const socketURL = 'ws://' + location.hostname + '/repl_ws/' + urlId;
  
    const destroyRepl = () => {
      // Request that the REPL be terminated.
      // Returns the promise for the DELETE request.
      console.log('destroying repl');
      //term.writeln('\n\r\033[31mREPL disconnected\033[0m'); // [1]
      //term.writeln('REPL disconnected');
      return fetch(replURL, { method: 'DELETE' });
    };
  
  
negative.code:       terminal.detach(that.socket);
        const NGINX_TIMEOUT_CODE = 1006;
        if (event.code === NGINX_TIMEOUT_CODE) {
          that.start(url, terminal); // Restart silently.
        }
      };
  
  