From f7d239f7236ff1733ddff755b08fe77e970b2b22 Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 8 Oct 2025 14:50:13 -0700 Subject: [PATCH 1/2] also copy wsh to "wave" (new alias for wsh) --- pkg/util/shellutil/shellutil.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/util/shellutil/shellutil.go b/pkg/util/shellutil/shellutil.go index d9b625a848..9930223b19 100644 --- a/pkg/util/shellutil/shellutil.go +++ b/pkg/util/shellutil/shellutil.go @@ -409,15 +409,21 @@ func initCustomShellStartupFilesInternal() error { return nil } wshDstPath := filepath.Join(binDir, "wsh") + waveDstPath := filepath.Join(binDir, "wave") if runtime.GOOS == "windows" { wshDstPath = wshDstPath + ".exe" + waveDstPath = waveDstPath + ".exe" } err = utilfn.AtomicRenameCopy(wshDstPath, wshFullPath, 0755) if err != nil { return fmt.Errorf("error copying wsh binary to bin: %v", err) } + err = utilfn.AtomicRenameCopy(waveDstPath, wshFullPath, 0755) + if err != nil { + return fmt.Errorf("error copying wave binary to bin: %v", err) + } wshBaseName := filepath.Base(wshFullPath) - log.Printf("wsh binary successfully copied from %q to %q\n", wshBaseName, wshDstPath) + log.Printf("wsh binary successfully copied from %q to %q and %q\n", wshBaseName, wshDstPath, waveDstPath) return nil } From 270d712c79eefd84693151170bd7d5b42d05e4c5 Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 8 Oct 2025 15:00:24 -0700 Subject: [PATCH 2/2] also install "wave" binary for WSL and remote conns... --- pkg/remote/connutil.go | 2 ++ pkg/wavebase/wavebase.go | 1 + pkg/wslconn/wsl-util.go | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/pkg/remote/connutil.go b/pkg/remote/connutil.go index de2e61a59c..5aae2b873f 100644 --- a/pkg/remote/connutil.go +++ b/pkg/remote/connutil.go @@ -95,6 +95,7 @@ mkdir -p {{.installDir}} || exit 1; cat > {{.tempPath}} || exit 1; mv {{.tempPath}} {{.installPath}} || exit 1; chmod a+x {{.installPath}} || exit 1; +cp {{.installPath}} {{.wavePath}} || exit 1; `) var installTemplate = template.Must(template.New("wsh-install-template").Parse(installTemplateRawDefault)) @@ -116,6 +117,7 @@ func CpWshToRemote(ctx context.Context, client *ssh.Client, clientOs string, cli "installDir": filepath.ToSlash(filepath.Dir(wavebase.RemoteFullWshBinPath)), "tempPath": wavebase.RemoteFullWshBinPath + ".temp", "installPath": wavebase.RemoteFullWshBinPath, + "wavePath": wavebase.RemoteFullWaveBinPath, } var installCmd bytes.Buffer if err := installTemplate.Execute(&installCmd, installWords); err != nil { diff --git a/pkg/wavebase/wavebase.go b/pkg/wavebase/wavebase.go index 1757429956..573900cbcf 100644 --- a/pkg/wavebase/wavebase.go +++ b/pkg/wavebase/wavebase.go @@ -62,6 +62,7 @@ const ConfigDir = "config" const RemoteWaveHomeDirName = ".waveterm" const RemoteWshBinDirName = "bin" const RemoteFullWshBinPath = "~/.waveterm/bin/wsh" +const RemoteFullWaveBinPath = "~/.waveterm/bin/wave" const RemoteFullDomainSocketPath = "~/.waveterm/wave-remote.sock" const AppPathBinDir = "bin" diff --git a/pkg/wslconn/wsl-util.go b/pkg/wslconn/wsl-util.go index 4e8876f402..1814539952 100644 --- a/pkg/wslconn/wsl-util.go +++ b/pkg/wslconn/wsl-util.go @@ -105,6 +105,7 @@ var installTemplatesRawBash = map[string]string{ "cat": `bash -c 'cat > {{.tempPath}}'`, "mv": `bash -c 'mv {{.tempPath}} {{.installPath}}'`, "chmod": `bash -c 'chmod a+x {{.installPath}}'`, + "cp": `bash -c 'cp {{.installPath}} {{.wavePath}}'`, } var installTemplatesRawDefault = map[string]string{ @@ -112,6 +113,7 @@ var installTemplatesRawDefault = map[string]string{ "cat": `cat > {{.tempPath}}`, "mv": `mv {{.tempPath}} {{.installPath}}`, "chmod": `chmod a+x {{.installPath}}`, + "cp": `cp {{.installPath}} {{.wavePath}}`, } func makeCancellableCommand(ctx context.Context, client *wsl.Distro, cmdTemplateRaw string, words map[string]string) (*CancellableCmd, error) { @@ -154,6 +156,7 @@ func CpWshToRemote(ctx context.Context, client *wsl.Distro, clientOs string, cli "installDir": filepath.ToSlash(filepath.Dir(wavebase.RemoteFullWshBinPath)), "tempPath": wavebase.RemoteFullWshBinPath + ".temp", "installPath": wavebase.RemoteFullWshBinPath, + "wavePath": wavebase.RemoteFullWaveBinPath, } blocklogger.Infof(ctx, "[conndebug] copying %q to remote server %q\n", wshLocalPath, wavebase.RemoteFullWshBinPath) @@ -216,6 +219,11 @@ func CpWshToRemote(ctx context.Context, client *wsl.Distro, clientOs string, cli return err } + _, err = installStepCmds["cp"].Cmd.Output() + if err != nil { + return err + } + return nil }