Repository: karaf
Updated Branches:
  refs/heads/master e14262ee4 -> 6414136a7


[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/6414136a
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/6414136a
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/6414136a

Branch: refs/heads/master
Commit: 6414136a75c07cdfee2e87c9314f3aec36372381
Parents: e14262e
Author: Guillaume Nodet <[email protected]>
Authored: Thu Sep 4 16:58:47 2014 +0200
Committer: Guillaume Nodet <[email protected]>
Committed: Thu Sep 4 17:00:25 2014 +0200

----------------------------------------------------------------------
 .../apache/karaf/shell/impl/console/ConsoleSessionImpl.java   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/6414136a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
----------------------------------------------------------------------
diff --git 
a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
 
b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
index 380eab7..3d63123 100644
--- 
a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
+++ 
b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
@@ -574,9 +574,16 @@ public class ConsoleSessionImpl implements Session {
         }
 
         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) {
                             return;

Reply via email to