+ cmd = append(cmd, "cd", folder.GetFullPath(args.RPath))
+ // FIXME - add 'exec' prevents to use syntax:
+ // xds-exec -l debug -c xds-config.env -- "cd build && cmake .."
+ // but exec is mandatory to allow to pass correctly signals
+ // As workaround, exec is set for now on client side (eg. in xds-gdb)
+ //cmd = append(cmd, "&&", "exec", args.Cmd)
+ cmd = append(cmd, "&&", args.Cmd)
+
+ // Process command arguments
+ cmdArgs := make([]string, len(args.Args)+1)
+ copy(cmdArgs, args.Args)
+
+ // Allocate pts if tty if used
+ if args.TTY {
+ gdbPty, gdbTty, err = pty.Open()
+ if err != nil {
+ common.APIError(c, err.Error())
+ return
+ }
+
+ s.log.Debugf("Client command tty: %v %v\n", gdbTty.Name(), gdbTty.Name())
+ cmdArgs = append(cmdArgs, "--tty="+gdbTty.Name())
+ }
+
+ // Unique ID for each commands
+ cmdID := strconv.Itoa(execCommandID)
+ execCommandID++
+
+ // Create new execution over WS context
+ execWS := eows.New(strings.Join(cmd, " "), cmdArgs, sop, sess.ID, cmdID)
+ execWS.Log = s.log
+
+ // Append client project dir to environment
+ execWS.Env = append(args.Env, "CLIENT_PROJECT_DIR="+prj.ClientPath)
+
+ // Set command execution timeout
+ if args.CmdTimeout == 0 {
+ // 0 : default timeout