Skip to content

Commit 217ac59

Browse files
mustard-mhroboquat
authored andcommitted
[code] codehelper exec replace process
1 parent 7ac5d9d commit 217ac59

File tree

1 file changed

+3
-4
lines changed
  • components/ide/code/codehelper

1 file changed

+3
-4
lines changed

components/ide/code/codehelper/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"regexp"
1717
"strings"
1818
"sync"
19+
"syscall"
1920
"time"
2021

2122
"google.golang.org/grpc"
@@ -103,13 +104,11 @@ func main() {
103104
log.WithField("cost", time.Now().Local().Sub(startTime).Milliseconds()).Info("extensions with path installed")
104105
}
105106

107+
// install extensions and run code server with exec
106108
args = append(args, os.Args[1:]...)
107109
args = append(args, "--do-not-sync")
108110
log.WithField("cost", time.Now().Local().Sub(startTime).Milliseconds()).Info("starting server")
109-
cmd := exec.Command(Code, args...)
110-
cmd.Stderr = os.Stderr
111-
cmd.Stdout = os.Stdout
112-
if err := cmd.Run(); err != nil {
111+
if err := syscall.Exec(Code, append([]string{"gitpod-code"}, args...), os.Environ()); err != nil {
113112
log.WithError(err).Error("install ext and start code server failed")
114113
}
115114
}

0 commit comments

Comments
 (0)