message: Wait after end of session for cygwin and WSL sessions
diff: @@ -95,6 +95,7 @@ class ProxyPty implements Pty {
  private _id: number = NULL_ID;
  private _writeFunc: (id: number, msg: ProxyMessage) => void = null;
  + private _waitingExitConfirmation = false;
  // Pre-open write queue.
  private _writeQueue: ProxyMessage[] = [];
  @@ -151,9 +152,16 @@ class ProxyPty implements Pty {
  }
  write(data: string): void {
  + if ( ! this._waitingExitConfirmation) {
  this._outstandingWriteDataCount += data.length;
  const msg: WriteMessage = { type: TYPE_WRITE, id: this._id, data: data };
  this._writeMessage(this._id, msg);
  + } else {
  + // See if the user hit the Enter key to fully close the terminal.
  + if (data.indexOf("\r") !== -1) {
  + this._onExitEventEmitter.fire(undefined);
  + }
  + }
  }
  getAvailableWriteBufferSize(): number {
  @@ -177,7 +185,8 @@ class ProxyPty implements Pty {
  }
  exit(): void {
  - this._onExitEventEmitter.fire(undefined);
  + this._waitingExitConfirmation = true;
  + this._onDataEventEmitter.fire("\n\n[Process exited. Press Enter to close this terminal.]");
  this._live = false;
  }
  