From f37fc926f55bd67c5d5de73d873dac6386266d8b Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 21 Jul 2005 04:53:27 +0000 Subject: [PATCH] break loop if not isatty --- .../java/src/net/hyperic/sigar/shell/ShellBase.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/shell/ShellBase.java b/bindings/java/src/net/hyperic/sigar/shell/ShellBase.java index cb6d06f5..40ddf56e 100644 --- a/bindings/java/src/net/hyperic/sigar/shell/ShellBase.java +++ b/bindings/java/src/net/hyperic/sigar/shell/ShellBase.java @@ -259,7 +259,12 @@ public abstract class ShellBase return; } if (input == null || input.trim().length() == 0) { - continue; + if (!Getline.isTTY()) { + break; + } + else { + continue; + } } try { @@ -268,7 +273,9 @@ public abstract class ShellBase break; } } - out.println("Goodbye."); + if (Getline.isTTY()) { + out.println("Goodbye."); + } } public void handleCommand(String line) {