You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/09/04 16:53:43 UTC

git commit: [KARAF-2878] Reenable the fix on non windows platforms

Repository: karaf
Updated Branches:
  refs/heads/karaf-2.x 900d5e3cf -> 92ffb93ae


[KARAF-2878] Reenable the fix on non windows platforms

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/92ffb93a
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/92ffb93a
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/92ffb93a

Branch: refs/heads/karaf-2.x
Commit: 92ffb93ae95ef1f433993e2a5f44db43c1e1e3a7
Parents: 900d5e3
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Thu Sep 4 16:53:25 2014 +0200
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Thu Sep 4 16:53:25 2014 +0200

----------------------------------------------------------------------
 .../java/org/apache/karaf/shell/console/jline/Console.java    | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/92ffb93a/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
----------------------------------------------------------------------
diff --git a/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java b/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
index 9ab8fda..ac48e0c 100644
--- a/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
+++ b/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
@@ -597,11 +597,18 @@ public class Console implements Runnable
     {
         public void run()
         {
+            boolean useAvailable = !System.getProperty("os.name").toLowerCase().contains("windows");
             try {
                 while (running)
                 {
                     try
                     {
+                        while (useAvailable && in.available() == 0) {
+                            if (!running) {
+                                return;
+                            }
+                            Thread.sleep(50);
+                        }
                         int c = in.read();
                         if (c == -1)
                         {