From c348e2b5c815f5586d5b166ccdb4728b67fc5527 Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Sat, 17 Aug 2019 06:35:02 -0500 Subject: [PATCH] expose ugly windows hack --- src/jexer/TTerminalWindow.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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)); } } -- 2.27.0