holgerfriedrich commented on code in PR #2926:
URL: https://github.com/apache/karaf/pull/2926#discussion_r4579583938
##########
client/src/main/java/org/apache/karaf/client/Main.java:
##########
@@ -188,7 +188,10 @@ else if (console != null) {
if (config.getCommand().length() > 0) {
ChannelExec channel =
session.createExecChannel(config.getCommand() + "\n");
channel.setIn(new ByteArrayInputStream(new byte[0]));
- if (!config.isBatch()) {
+ // watch stdin to let the user abort the command with EOF
(ctrl-d), but only when
+ // stdin is a terminal - when it is redirected (script,
pipe, cron) EOF is reached
+ // immediately and would close the channel before any
output is received
+ if (!config.isBatch() && isTerminal(console)) {
Review Comment:
thanks for the suggestion, the PR is now much smaller!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]