From 87944ff808a217ddd782983cc009e9d19e702d77 Mon Sep 17 00:00:00 2001 From: iddoeldor Date: Tue, 31 Jul 2018 13:15:19 +0300 Subject: [PATCH] handle stderr --- scripts/exec_shell_cmd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/exec_shell_cmd.py b/scripts/exec_shell_cmd.py index 6fc1e31..bfc39ae 100644 --- a/scripts/exec_shell_cmd.py +++ b/scripts/exec_shell_cmd.py @@ -63,7 +63,10 @@ class Shell(object): def _on_output(self, pid, fd, data): # if len(data) > 0: # print("⚡ output: pid={}, fd={}, data={}".format(pid, fd, repr(data))) - self.output.append(data) + # fd=0 (input) fd=1(stdout) fd=2(stderr) + # TODO handle fd=2 + if fd != 2: + self.output.append(data) def _on_detached(self, pid, session, reason): click.secho("⚡ detached: pid={}, reason='{}'".format(pid, reason), fg='green', dim=True)