From 17812a0a4388ab0c87084ef7e8118d87e8fadcf7 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Fri, 9 Mar 2018 17:19:50 +0100 Subject: Fixed terminal output (support escape and control characters) Signed-off-by: Sebastien Douheret --- lib/xdsserver/sdk.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/xdsserver/sdk.go') diff --git a/lib/xdsserver/sdk.go b/lib/xdsserver/sdk.go index 374fb12..c1bf043 100644 --- a/lib/xdsserver/sdk.go +++ b/lib/xdsserver/sdk.go @@ -247,6 +247,7 @@ func (s *CrossSDK) Install(file string, force bool, timeout int, args []string, // Create new instance to execute command and sent output over WS s.installCmd = eows.New(s.scripts[scriptAdd], cmdArgs, sess.IOSocket, sess.ID, cmdID) s.installCmd.Log = s.Log + // TODO: enable Term s.installCmd.PtyMode = true s.installCmd.LineTimeSpan = 500 * time.Millisecond.Nanoseconds() if timeout > 0 { s.installCmd.CmdExecTimeout = timeout @@ -255,7 +256,11 @@ func (s *CrossSDK) Install(file string, force bool, timeout int, args []string, } // Define callback for output (stdout+stderr) - s.installCmd.OutputCB = func(e *eows.ExecOverWS, stdout, stderr string) { + s.installCmd.OutputCB = func(e *eows.ExecOverWS, bStdout, bStderr []byte) { + + stdout := string(bStdout) + stderr := string(bStderr) + // paranoia data := e.UserData sdkID := (*data)["SDKID"].(string) -- cgit 1.2.3-korg