diff --git a/pkg/shellexec/shellexec.go b/pkg/shellexec/shellexec.go index d22cdbb1f..2c811d85c 100644 --- a/pkg/shellexec/shellexec.go +++ b/pkg/shellexec/shellexec.go @@ -167,9 +167,6 @@ func StartWslShellProc(ctx context.Context, termSize waveobj.TermSize, cmdStr st homeDir := wsl.GetHomeDir(conn.Context, client) shellOpts = append(shellOpts, "~", "-d", client.Name()) - if isZshShell(shellPath) { - shellOpts = append(shellOpts, fmt.Sprintf(`ZDOTDIR="%s/.waveterm/%s"`, homeDir, shellutil.ZshIntegrationDir)) - } var subShellOpts []string if cmdStr == "" { @@ -216,6 +213,10 @@ func StartWslShellProc(ctx context.Context, termSize waveobj.TermSize, cmdStr st } else { shellOpts = append(shellOpts, "--", fmt.Sprintf(`%s=%s`, wshutil.WaveJwtTokenVarName, jwtToken)) } + + if isZshShell(shellPath) { + shellOpts = append(shellOpts, fmt.Sprintf(`ZDOTDIR="%s/.waveterm/%s"`, homeDir, shellutil.ZshIntegrationDir)) + } shellOpts = append(shellOpts, shellPath) shellOpts = append(shellOpts, subShellOpts...) log.Printf("full cmd is: %s %s", "wsl.exe", strings.Join(shellOpts, " "))