retrofit from GJexer
[nikiroo-utils.git] / src / jexer / TTerminalWindow.java
index ec4fd07ec7957cffe92943d001798ae2df79a41e..b55e7b05bc1137600ea337cb71acc2ba29976b87 100644 (file)
@@ -101,7 +101,7 @@ public class TTerminalWindow extends TScrollableWindow
     public TTerminalWindow(final TApplication application, final int x,
         final int y, final String commandLine) {
 
-        this(application, x, y, RESIZABLE, commandLine.split("\\s"),
+        this(application, x, y, RESIZABLE, commandLine.split("\\s+"),
             System.getProperty("jexer.TTerminal.closeOnExit",
                 "false").equals("true"));
     }
@@ -118,7 +118,7 @@ public class TTerminalWindow extends TScrollableWindow
     public TTerminalWindow(final TApplication application, final int x,
         final int y, final String commandLine, final boolean closeOnExit) {
 
-        this(application, x, y, RESIZABLE, commandLine.split("\\s"),
+        this(application, x, y, RESIZABLE, commandLine.split("\\s+"),
             closeOnExit);
     }
 
@@ -247,16 +247,16 @@ public class TTerminalWindow extends TScrollableWindow
                 equals("true"))
         ) {
             ptypipe = true;
-            spawnShell(cmdShellPtypipe.split("\\s"));
+            spawnShell(cmdShellPtypipe.split("\\s+"));
         } else if (System.getProperty("os.name").startsWith("Windows")) {
-            spawnShell(cmdShellWindows.split("\\s"));
+            spawnShell(cmdShellWindows.split("\\s+"));
         } else if (System.getProperty("os.name").startsWith("Mac")) {
-            spawnShell(cmdShellBSD.split("\\s"));
+            spawnShell(cmdShellBSD.split("\\s+"));
         } else if (System.getProperty("os.name").startsWith("Linux")) {
-            spawnShell(cmdShellGNU.split("\\s"));
+            spawnShell(cmdShellGNU.split("\\s+"));
         } else {
             // When all else fails, assume GNU.
-            spawnShell(cmdShellGNU.split("\\s"));
+            spawnShell(cmdShellGNU.split("\\s+"));
         }
     }