Skip to content

Commit 246640a

Browse files
committed
fix: use regular context for shellproc
1 parent 83dbbf6 commit 246640a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/shellexec/shellexec.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,10 @@ func (pp *PipePty) WriteString(s string) (n int, err error) {
148148
}
149149

150150
func StartWslShellProc(ctx context.Context, termSize waveobj.TermSize, cmdStr string, cmdOpts CommandOptsType, conn *wsl.WslConn) (*ShellProc, error) {
151-
shellProcCtx, cancelFn := context.WithCancel(ctx)
152-
defer cancelFn()
153151
client := conn.GetClient()
154152
shellPath := cmdOpts.ShellPath
155153
if shellPath == "" {
156-
remoteShellPath, err := wsl.DetectShell(shellProcCtx, client)
154+
remoteShellPath, err := wsl.DetectShell(ctx, client)
157155
if err != nil {
158156
return nil, err
159157
}
@@ -162,13 +160,13 @@ func StartWslShellProc(ctx context.Context, termSize waveobj.TermSize, cmdStr st
162160
var shellOpts []string
163161
log.Printf("detected shell: %s", shellPath)
164162

165-
err := wsl.InstallClientRcFiles(shellProcCtx, client)
163+
err := wsl.InstallClientRcFiles(ctx, client)
166164
if err != nil {
167165
log.Printf("error installing rc files: %v", err)
168166
return nil, err
169167
}
170168

171-
homeDir := wsl.GetHomeDir(shellProcCtx, client)
169+
homeDir := wsl.GetHomeDir(ctx, client)
172170
shellOpts = append(shellOpts, "~", "-d", client.Name())
173171

174172
var subShellOpts []string

0 commit comments

Comments
 (0)