Skip to content
Merged
30 changes: 30 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ tasks:
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev/"

electron:winquickdev:
desc: Run the Electron application via the Vite dev server (quick dev - Windows amd64 only, no generate, no wsh).
cmd: npm run dev
deps:
- npm:install
- build:backend:quickdev:windows
env:
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev/"

Comment on lines +57 to +67
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Gate electron:winquickdev to Windows to prevent accidental use on other platforms.
The task description explicitly states "Windows amd64 only", but it lacks a platforms: [windows] guard. Add it to match the pattern used by its dependency build:backend:quickdev:windows and other platform-specific tasks in the file.

     electron:winquickdev:
         desc: Run the Electron application via the Vite dev server (quick dev - Windows amd64 only, no generate, no wsh).
+        platforms: [windows]
         cmd: npm run dev
         deps:
             - npm:install
             - build:backend:quickdev:windows
🤖 Prompt for AI Agents
In Taskfile.yml around lines 57 to 67, the electron:winquickdev task is flagged
as "Windows amd64 only" but lacks a platforms guard; add a platforms: [windows]
entry under the task (matching the format used by build:backend:quickdev:windows
and other platform-specific tasks) so the task is gated to Windows and cannot be
invoked on other platforms.

docs:npm:install:
desc: Runs `npm install` in docs directory
internal: true
Expand Down Expand Up @@ -186,6 +197,25 @@ tasks:
generates:
- dist/bin/wavesrv.*

build:backend:quickdev:windows:
desc: Build only the wavesrv component for quickdev (Windows amd64 only, no generate, no wsh).
platforms: [windows]
cmds:
- task: build:server:internal
vars:
ARCHS: amd64
GO_ENV_VARS: CC="zig cc -target x86_64-windows-gnu"
deps:
- go:mod:tidy
sources:
- "cmd/server/*.go"
- "pkg/**/*.go"
- "pkg/**/*.json"
- "pkg/**/*.sh"
- "tsunami/**/*.go"
generates:
- dist/bin/wavesrv.x64.exe

Comment on lines +200 to +218
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find Taskfile.yml
find . -name "Taskfile.yml" -o -name "Taskfile.yaml" | head -20

Repository: wavetermdev/waveterm

Length of output: 78


🏁 Script executed:

# Get file size to understand what we're working with
wc -l ./Taskfile.yml

Repository: wavetermdev/waveterm

Length of output: 82


🏁 Script executed:

# Read lines 200-218 (build:backend:quickdev:windows)
sed -n '200,218p' ./Taskfile.yml

# Read around Line 250 (build:server:internal)
sed -n '245,260p' ./Taskfile.yml

# Find build:server:windows
grep -n "build:server:windows" ./Taskfile.yml

Repository: wavetermdev/waveterm

Length of output: 1443


🏁 Script executed:

# Read the build:server:windows task definition
sed -n '219,250p' ./Taskfile.yml

Repository: wavetermdev/waveterm

Length of output: 1741


🏁 Script executed:

# Look for any Task-related configuration files or comments about shell behavior
grep -r "shell\|cmd\.exe\|PowerShell\|bash" ./Taskfile.yml | head -20

# Check for any .taskfiles or includes
ls -la | grep -i task

# Look for any GitHub Actions or CI configuration that might reveal how Task is used on Windows
find . -name "*.yml" -o -name "*.yaml" | grep -E "(workflow|action|ci|github)" | head -10

Repository: wavetermdev/waveterm

Length of output: 2122


🏁 Script executed:

# Check GitHub workflows for Windows builds
ls -la ./.github/workflows/

# Look for Windows-specific build workflows
grep -l "windows\|Windows" ./.github/workflows/*.yml

Repository: wavetermdev/waveterm

Length of output: 945


🏁 Script executed:

# Check build-helper.yml for Windows task execution
cat -n ./.github/workflows/build-helper.yml | grep -A 10 -B 10 "windows\|Windows\|task"

Repository: wavetermdev/waveterm

Length of output: 9708


🏁 Script executed:

# Search for any issues or comments related to GO_ENV_VARS or Windows build issues
grep -n "GO_ENV_VARS\|shell\|zig cc" ./Taskfile.yml | head -30

# Look for any recent changes or git history comments
git log --oneline -20 2>/dev/null | head -10

Repository: wavetermdev/waveterm

Length of output: 2605


🏁 Script executed:

# Search for Task documentation or any comments about shell behavior
grep -rn "task\|Task\|shell" . --include="*.md" --include="*.txt" 2>/dev/null | grep -i "windows\|shell\|bash" | head -20

# Check README for build instructions
head -100 ./README.md 2>/dev/null || echo "No README"

# Look for any task-related documentation
find . -name "*[Tt]ask*" -type f 2>/dev/null | grep -v node_modules | grep -v ".git"

Repository: wavetermdev/waveterm

Length of output: 6905


🏁 Script executed:

# Check BUILD.md for build instructions
cat ./BUILD.md | head -150

# Look for any Task-related information in the repo
grep -rn "sh:" ./Taskfile.yml | head -20

Repository: wavetermdev/waveterm

Length of output: 5129


🏁 Script executed:

# Search for any usage of build:backend:quickdev:windows
grep -rn "build:backend:quickdev:windows\|quickdev" . --include="*.yml" --include="*.yaml" --include="*.md" 2>/dev/null

# Look for any issue reports or comments about Windows builds
grep -rn "windows\|Windows" ./.github/workflows/ | grep -i "task\|build" | head -20

Repository: wavetermdev/waveterm

Length of output: 3279


🏁 Script executed:

# Search for any GitHub issues or error reports related to Windows build
git log --all --grep="windows\|Windows\|GO_ENV_VARS" --oneline 2>/dev/null | head -20

# Check if there are any recent changes to the Taskfile
git log --oneline -30 -- Taskfile.yml 2>/dev/null

# Look for any comments or TODOs in the Taskfile
grep -n "TODO\|FIXME\|BUG\|HACK\|NOTE" ./Taskfile.yml

Repository: wavetermdev/waveterm

Length of output: 1370


🏁 Script executed:

# Check commit e6b4e36 for the Windows build error fix
git show e6b4e36 --stat 2>/dev/null | head -50

# Also check commit 79210f0
git show 79210f0 2>/dev/null | head -100

Repository: wavetermdev/waveterm

Length of output: 1226


🏁 Script executed:

# Look for any GitHub issues mentioning the build task or quickdev
find ./.github -name "*.md" -o -name "*.txt" | xargs grep -l "quickdev\|GO_ENV_VARS" 2>/dev/null

# Check if there are any test workflows
ls -la ./.github/workflows/

# Look for any recent issues or PRs
git log --all --oneline --grep="quickdev\|GO_ENV_VARS\|backend:quickdev" 2>/dev/null | head -20

Repository: wavetermdev/waveterm

Length of output: 792


🏁 Script executed:

# Get the exact structure of build:server:internal more carefully
sed -n '245,260p' ./Taskfile.yml | cat -A

Repository: wavetermdev/waveterm

Length of output: 773


🏁 Script executed:

# Search for electron:winquickdev usage in workflows or documentation
grep -rn "electron:winquickdev\|build:backend:quickdev:windows" ./.github/ ./README.md ./BUILD.md 2>/dev/null

Repository: wavetermdev/waveterm

Length of output: 46


Use sh: echo for GO_ENV_VARS to ensure consistent Windows shell behavior.

build:backend:quickdev:windows hard-codes GO_ENV_VARS: CC="zig cc -target x86_64-windows-gnu", while build:server:windows (line 219+) uses sh: echo to compute it. On Windows, the hard-coded approach may fail because the cmd: field in build:server:internal (line 250) executes POSIX-style environment variable syntax (CGO_ENABLED=1 GOARCH={{.GOARCH}} {{.GO_ENV_VARS}}...), which cmd.exe/PowerShell don't reliably handle without explicit shell execution. The sh: echo pattern already proven in build:server:windows should be applied here for consistency:

     build:backend:quickdev:windows:
       desc: Build only the wavesrv component for quickdev (Windows amd64 only, no generate, no wsh).
       platforms: [windows]
       cmds:
         - task: build:server:internal
           vars:
             ARCHS: amd64
-            GO_ENV_VARS: CC="zig cc -target x86_64-windows-gnu"
+            GO_ENV_VARS:
+              sh: echo 'CC="zig cc -target x86_64-windows-gnu"'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
build:backend:quickdev:windows:
desc: Build only the wavesrv component for quickdev (Windows amd64 only, no generate, no wsh).
platforms: [windows]
cmds:
- task: build:server:internal
vars:
ARCHS: amd64
GO_ENV_VARS: CC="zig cc -target x86_64-windows-gnu"
deps:
- go:mod:tidy
sources:
- "cmd/server/*.go"
- "pkg/**/*.go"
- "pkg/**/*.json"
- "pkg/**/*.sh"
- "tsunami/**/*.go"
generates:
- dist/bin/wavesrv.x64.exe
build:backend:quickdev:windows:
desc: Build only the wavesrv component for quickdev (Windows amd64 only, no generate, no wsh).
platforms: [windows]
cmds:
- task: build:server:internal
vars:
ARCHS: amd64
GO_ENV_VARS:
sh: echo 'CC="zig cc -target x86_64-windows-gnu"'
deps:
- go:mod:tidy
sources:
- "cmd/server/*.go"
- "pkg/**/*.go"
- "pkg/**/*.json"
- "pkg/**/*.sh"
- "tsunami/**/*.go"
generates:
- dist/bin/wavesrv.x64.exe
🤖 Prompt for AI Agents
In Taskfile.yml around lines 200 to 218, the GO_ENV_VARS for
build:backend:quickdev:windows is hard-coded which can break on Windows shells;
change the vars entry to use the same sh: echo pattern used in
build:server:windows so the environment string is emitted by the shell
(preserving the CC="zig cc -target x86_64-windows-gnu" value and any quoting)
instead of embedding it directly, ensuring the downstream cmd: that sets
CGO_ENABLED/GOARCH can consume a POSIX-style env string reliably on Windows.

build:server:windows:
desc: Build the wavesrv component for Windows platforms (only generates artifacts for the current architecture).
platforms: [windows]
Expand Down
5 changes: 3 additions & 2 deletions frontend/app/block/blockframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ const BlockFrame_Header = ({
icon: "link-slash",
title: "wsh is not installed for this connection",
};
const showNoWshButton = manageConnection && wshProblem && !util.isBlank(connName) && !connName.startsWith("aws:");
const showNoWshButton =
manageConnection && wshProblem && !util.isLocalConnName(connName) && !connName.startsWith("aws:");

return (
<div
Expand Down Expand Up @@ -600,7 +601,7 @@ const BlockFrame_Default_Component = (props: BlockFrameProps) => {
return;
}
const connName = blockData?.meta?.connection;
if (!util.isBlank(connName)) {
if (!util.isLocalConnName(connName)) {
console.log("ensure conn", nodeModel.blockId, connName);
RpcApi.ConnEnsureCommand(
TabRpcClient,
Expand Down
16 changes: 13 additions & 3 deletions frontend/app/block/blockutil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const ConnectionButton = React.memo(
React.forwardRef<HTMLDivElement, ConnectionButtonProps>(
({ connection, changeConnModalAtom }: ConnectionButtonProps, ref) => {
const [connModalOpen, setConnModalOpen] = jotai.useAtom(changeConnModalAtom);
const isLocal = util.isBlank(connection);
const isLocal = util.isLocalConnName(connection);
const connStatusAtom = getConnStatusAtom(connection);
const connStatus = jotai.useAtomValue(connStatusAtom);
let showDisconnectedSlash = false;
Expand All @@ -178,9 +178,15 @@ export const ConnectionButton = React.memo(
};
let titleText = null;
let shouldSpin = false;
let connDisplayName: string = null;
if (isLocal) {
color = "var(--grey-text-color)";
titleText = "Connected to Local Machine";
if (connection === "local:gitbash") {
titleText = "Connected to Git Bash";
connDisplayName = "Git Bash";
} else {
titleText = "Connected to Local Machine";
}
connIconElem = (
<i
className={clsx(util.makeIconClass("laptop", false), "fa-stack-1x")}
Expand Down Expand Up @@ -238,7 +244,11 @@ export const ConnectionButton = React.memo(
}}
/>
</span>
{isLocal ? null : <div className="connection-name ellipsis">{connection}</div>}
{connDisplayName ? (
<div className="connection-name ellipsis">{connDisplayName}</div>
) : isLocal ? null : (
<div className="connection-name ellipsis">{connection}</div>
)}
</div>
);
}
Expand Down
40 changes: 24 additions & 16 deletions frontend/app/modals/conntypeahead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

import { computeConnColorNum } from "@/app/block/blockutil";
import { TypeAheadModal } from "@/app/modals/typeaheadmodal";
import {
atoms,
createBlock,
getApi,
getConnStatusAtom,
getHostName,
getUserName,
globalStore,
WOS,
} from "@/app/store/global";
import { ConnectionsModel } from "@/app/store/connections-model";
import { atoms, createBlock, getConnStatusAtom, getHostName, getUserName, globalStore, WOS } from "@/app/store/global";
import { globalRefocusWithTimeout } from "@/app/store/keymodel";
import { RpcApi } from "@/app/store/wshclientapi";
import { TabRpcClient } from "@/app/store/wshrpcutil";
Expand Down Expand Up @@ -107,7 +99,7 @@ function createFilteredLocalSuggestionItem(
iconColor: "var(--grey-text-color)",
value: "",
label: localName,
current: connection == null,
current: util.isBlank(connection),
};
return [localSuggestion];
}
Expand Down Expand Up @@ -172,12 +164,26 @@ function getLocalSuggestions(
connSelected: string,
connStatusMap: Map<string, ConnStatus>,
fullConfig: FullConfigType,
filterOutNowsh: boolean
filterOutNowsh: boolean,
hasGitBash: boolean
): SuggestionConnectionScope | null {
const wslFiltered = filterConnections(connList, connSelected, fullConfig, filterOutNowsh);
const wslSuggestionItems = createWslSuggestionItems(wslFiltered, connection, connStatusMap);
const localSuggestionItem = createFilteredLocalSuggestionItem(localName, connection, connSelected);
const combinedSuggestionItems = [...localSuggestionItem, ...wslSuggestionItems];

const gitBashItems: Array<SuggestionConnectionItem> = [];
if (hasGitBash && "Git Bash".toLowerCase().includes(connSelected.toLowerCase())) {
gitBashItems.push({
status: "connected",
icon: "laptop",
iconColor: "var(--grey-text-color)",
value: "local:gitbash",
label: "Git Bash",
current: connection === "local:gitbash",
});
}

const combinedSuggestionItems = [...localSuggestionItem, ...gitBashItems, ...wslSuggestionItems];
const sortedSuggestionItems = sortConnSuggestionItems(combinedSuggestionItems, fullConfig);
if (sortedSuggestionItems.length == 0) {
return null;
Expand Down Expand Up @@ -235,7 +241,7 @@ function getDisconnectItem(
connection: string,
connStatusMap: Map<string, ConnStatus>
): SuggestionConnectionItem | null {
if (!connection) {
if (util.isLocalConnName(connection)) {
return null;
}
const connStatus = connStatusMap.get(connection);
Expand Down Expand Up @@ -346,6 +352,7 @@ const ChangeConnectionBlockModal = React.memo(
const fullConfig = jotai.useAtomValue(atoms.fullConfigAtom);
let filterOutNowsh = util.useAtomValueSafe(viewModel.filterOutNowsh) ?? true;
const showS3 = util.useAtomValueSafe(viewModel.showS3) ?? false;
const hasGitBash = jotai.useAtomValue(ConnectionsModel.getInstance().hasGitBashAtom);

let maxActiveConnNum = 1;
for (const conn of allConnStatus) {
Expand Down Expand Up @@ -402,7 +409,7 @@ const ChangeConnectionBlockModal = React.memo(
oref: WOS.makeORef("block", blockId),
meta: { connection: connName, file: newFile, "cmd:cwd": null },
});

try {
await RpcApi.ConnEnsureCommand(
TabRpcClient,
Expand All @@ -425,7 +432,8 @@ const ChangeConnectionBlockModal = React.memo(
connSelected,
connStatusMap,
fullConfig,
filterOutNowsh
filterOutNowsh,
hasGitBash
);
const remoteSuggestions = getRemoteSuggestions(
connList,
Expand Down
51 changes: 51 additions & 0 deletions frontend/app/store/connections-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2025, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0

import { RpcApi } from "@/app/store/wshclientapi";
import { TabRpcClient } from "@/app/store/wshrpcutil";
import { isWindows } from "@/util/platformutil";
import { atom, type Atom, type PrimitiveAtom } from "jotai";
import { globalStore } from "./jotaiStore";

class ConnectionsModel {
private static instance: ConnectionsModel;
gitBashPathAtom: PrimitiveAtom<string> = atom("") as PrimitiveAtom<string>;
hasGitBashAtom: Atom<boolean>;

private constructor() {
this.hasGitBashAtom = atom((get) => {
if (!isWindows()) {
return false;
}
const path = get(this.gitBashPathAtom);
return path !== "";
});
this.loadGitBashPath();
}

static getInstance(): ConnectionsModel {
if (!ConnectionsModel.instance) {
ConnectionsModel.instance = new ConnectionsModel();
}
return ConnectionsModel.instance;
}

async loadGitBashPath(rescan: boolean = false): Promise<void> {
if (!isWindows()) {
return;
}
try {
const path = await RpcApi.FindGitBashCommand(TabRpcClient, rescan, { timeout: 2000 });
globalStore.set(this.gitBashPathAtom, path);
} catch (error) {
console.error("Failed to find git bash path:", error);
globalStore.set(this.gitBashPathAtom, "");
}
}

getGitBashPath(): string {
return globalStore.get(this.gitBashPathAtom);
}
}

export { ConnectionsModel };
12 changes: 9 additions & 3 deletions frontend/app/store/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ import {
import { getWebServerEndpoint } from "@/util/endpoints";
import { fetch } from "@/util/fetchutil";
import { setPlatform } from "@/util/platformutil";
import { base64ToString, deepCompareReturnPrev, fireAndForget, getPrefixedSettings, isBlank } from "@/util/util";
import {
base64ToString,
deepCompareReturnPrev,
fireAndForget,
getPrefixedSettings,
isBlank,
isLocalConnName,
} from "@/util/util";
import { atom, Atom, PrimitiveAtom, useAtomValue } from "jotai";
import { globalStore } from "./jotaiStore";
import { modalsModel } from "./modalmodel";
Expand Down Expand Up @@ -730,8 +737,7 @@ function getConnStatusAtom(conn: string): PrimitiveAtom<ConnStatus> {
const connStatusMap = globalStore.get(ConnStatusMapAtom);
let rtn = connStatusMap.get(conn);
if (rtn == null) {
if (isBlank(conn)) {
// create a fake "local" status atom that's always connected
if (isLocalConnName(conn)) {
const connStatus: ConnStatus = {
connection: conn,
connected: true,
Expand Down
5 changes: 5 additions & 0 deletions frontend/app/store/wshclientapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ class RpcApiType {
return client.wshRpcCall("filewrite", data, opts);
}

// command "findgitbash" [call]
FindGitBashCommand(client: WshClient, data: boolean, opts?: RpcOpts): Promise<string> {
return client.wshRpcCall("findgitbash", data, opts);
}

// command "focuswindow" [call]
FocusWindowCommand(client: WshClient, data: string, opts?: RpcOpts): Promise<void> {
return client.wshRpcCall("focuswindow", data, opts);
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/view/term/termwrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,14 @@ export class TermWrap {
oref: WOS.makeORef("block", this.blockId),
});

if (rtInfo["shell:integration"]) {
if (rtInfo && rtInfo["shell:integration"]) {
const shellState = rtInfo["shell:state"] as ShellIntegrationStatus;
globalStore.set(this.shellIntegrationStatusAtom, shellState || null);
} else {
globalStore.set(this.shellIntegrationStatusAtom, null);
}

const lastCmd = rtInfo["shell:lastcmd"];
const lastCmd = rtInfo ? rtInfo["shell:lastcmd"] : null;
globalStore.set(this.lastCommandAtom, lastCmd || null);
} catch (e) {
console.log("Error loading runtime info:", e);
Expand Down
1 change: 1 addition & 0 deletions frontend/types/gotypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@ declare global {
"term:disablewebgl"?: boolean;
"term:localshellpath"?: string;
"term:localshellopts"?: string[];
"term:gitbashpath"?: string;
"term:scrollback"?: number;
"term:copyonselect"?: boolean;
"term:transparency"?: number;
Expand Down
8 changes: 8 additions & 0 deletions frontend/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ function isBlank(str: string): boolean {
return str == null || str == "";
}

function isLocalConnName(connName: string): boolean {
if (isBlank(connName)) {
return true;
}
return connName === "local" || connName.startsWith("local:");
}

function base64ToString(b64: string): string {
if (b64 == null) {
return null;
Expand Down Expand Up @@ -509,6 +516,7 @@ export {
getPromiseState,
getPromiseValue,
isBlank,
isLocalConnName,
jotaiLoadableValue,
jsonDeepEqual,
lazy,
Expand Down
13 changes: 7 additions & 6 deletions pkg/blockcontroller/blockcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ func getController(blockId string) Controller {

func registerController(blockId string, controller Controller) {
var existingController Controller

registryLock.Lock()
existing, exists := controllerRegistry[blockId]
if exists {
existingController = existing
}
controllerRegistry[blockId] = controller
registryLock.Unlock()

if existingController != nil {
existingController.Stop(false, Status_Done)
wstore.DeleteRTInfo(waveobj.MakeORef(waveobj.OType_Block, blockId))
Expand Down Expand Up @@ -169,8 +169,9 @@ func ResyncController(ctx context.Context, tabId string, blockId string, rtOpts
// For shell/cmd, check if connection changed
if !needsReplace && (controllerName == BlockController_Shell || controllerName == BlockController_Cmd) {
connName := blockData.Meta.GetString(waveobj.MetaKey_Connection, "")
// Check if connection changed, including between different local connections
if existingStatus.ShellProcStatus == Status_Running && existingStatus.ShellProcConnName != connName {
log.Printf("stopping blockcontroller %s due to conn change\n", blockId)
log.Printf("stopping blockcontroller %s due to conn change (from %q to %q)\n", blockId, existingStatus.ShellProcConnName, connName)
StopBlockControllerAndSetStatus(blockId, Status_Init)
time.Sleep(100 * time.Millisecond)
// Don't delete, will reuse same controller type
Expand Down Expand Up @@ -209,10 +210,10 @@ func ResyncController(ctx context.Context, tabId string, blockId string, rtOpts
// Check if we need to start/restart
status := controller.GetRuntimeStatus()
if status.ShellProcStatus == Status_Init || status.ShellProcStatus == Status_Done {
// For shell/cmd, check connection status first
// For shell/cmd, check connection status first (for non-local connections)
if controllerName == BlockController_Shell || controllerName == BlockController_Cmd {
connName := blockData.Meta.GetString(waveobj.MetaKey_Connection, "")
if connName != "" {
if !conncontroller.IsLocalConnName(connName) {
err = CheckConnStatus(blockId)
if err != nil {
return fmt.Errorf("cannot start shellproc: %w", err)
Expand Down Expand Up @@ -362,7 +363,7 @@ func CheckConnStatus(blockId string) error {
return fmt.Errorf("error getting block: %w", err)
}
connName := bdata.Meta.GetString(waveobj.MetaKey_Connection, "")
if connName == "" {
if conncontroller.IsLocalConnName(connName) {
return nil
}
if strings.HasPrefix(connName, "wsl://") {
Expand Down
Loading
Loading