X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTTerminalWindow.java;h=90a95ae132abdbd5360a06c535f57b0fac2965ef;hb=69345248812de6884a0ff061101264d47eae0509;hp=83cc86ef19d0f5a890699d41ec102d86de8dca50;hpb=34a42e784bf1238c6bb2847c52d7c841fcfdef5f;p=nikiroo-utils.git diff --git a/src/jexer/TTerminalWindow.java b/src/jexer/TTerminalWindow.java index 83cc86e..90a95ae 100644 --- a/src/jexer/TTerminalWindow.java +++ b/src/jexer/TTerminalWindow.java @@ -244,7 +244,12 @@ public class TTerminalWindow extends TWindow { * Handle window close. */ @Override public void onClose() { - emulator.close(); + if (shell != null) { + shell.destroy(); + shell = null; + } else { + emulator.close(); + } } /** @@ -297,7 +302,7 @@ public class TTerminalWindow extends TWindow { // The shell is still running, do nothing. } } - + } // synchronized (emulator) } @@ -386,6 +391,15 @@ public class TTerminalWindow extends TWindow { // Get out of scrollback vScroller.setValue(0); emulator.keypress(keypress.getKey()); + + // UGLY HACK TIME! cmd.exe needs CRLF, not just CR, so if + // this is kBEnter then also send kbCtrlJ. + if (System.getProperty("os.name").startsWith("Windows")) { + if (keypress.equals(kbEnter)) { + emulator.keypress(kbCtrlJ); + } + } + readEmulatorState(); return; }