summaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/sdk.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-03-09 17:19:50 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-03-09 17:19:50 +0100
commit17812a0a4388ab0c87084ef7e8118d87e8fadcf7 (patch)
treefafa3e95348087028e27a0b13ee02bd5aa734fd6 /lib/xdsserver/sdk.go
parent65e09e831cf13343ac713fbf15281174d1f13a94 (diff)
Fixed terminal output (support escape and control characters)
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsserver/sdk.go')
-rw-r--r--lib/xdsserver/sdk.go7
1 files changed, 6 insertions, 1 deletions
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)