From: Kevin Lamonte Date: Sat, 17 Aug 2019 11:35:02 +0000 (-0500) Subject: expose ugly windows hack X-Git-Tag: fanfix-3.0.1^2~72 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=c348e2b5c815f5586d5b166ccdb4728b67fc5527;p=fanfix.git expose ugly windows hack --- diff --git a/src/jexer/TTerminalWindow.java b/src/jexer/TTerminalWindow.java index 320c67a..2106cf0 100644 --- a/src/jexer/TTerminalWindow.java +++ b/src/jexer/TTerminalWindow.java @@ -296,6 +296,15 @@ public class TTerminalWindow extends TScrollableWindow this.closeOnExit = closeOnExit; + if (System.getProperty("jexer.TTerminal.shell") != null) { + String shell = System.getProperty("jexer.TTerminal.shell"); + if (shell.trim().startsWith("ptypipe")) { + ptypipe = true; + } + spawnShell(shell.split("\\s+")); + return; + } + String cmdShellWindows = "cmd.exe"; // You cannot run a login shell in a bare Process interactively, due @@ -559,8 +568,11 @@ public class TTerminalWindow extends TScrollableWindow // 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)) { + if (keypress.equals(kbEnter)) { + if (System.getProperty("os.name").startsWith("Windows") + && (System.getProperty("jexer.TTerminal.cmdHack", + "true").equals("true")) + ) { emulator.addUserEvent(new TKeypressEvent(kbCtrlJ)); } }