wavetermdev/waveterm · error

--workspace and --window are mutually exclusive; specify onl

Error message

--workspace and --window are mutually exclusive; specify only one

What it means

Argument-validation error from `wsh blocks list` when both --workspace and --window flags are supplied. The two flags are alternative ways to scope the block listing, and the command forbids combining them. Thrown before any RPC other than the workspace listing is performed.

Source

Thrown at cmd/wsh/cmd/wshcmd-blocks.go:122

		}
	}

	var allBlocks []BlockDetails

	workspaces, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: int64(blocksTimeout)})
	if err != nil {
		return fmt.Errorf("failed to list workspaces: %v", err)
	}

	if len(workspaces) == 0 {
		return fmt.Errorf("no workspaces found")
	}

	var workspaceIdsToQuery []string

	// Determine which workspaces to query
	if blocksWorkspaceId != "" && blocksWindowId != "" {
		return fmt.Errorf("--workspace and --window are mutually exclusive; specify only one")
	}
	if blocksWorkspaceId != "" {
		workspaceIdsToQuery = []string{blocksWorkspaceId}
	} else if blocksWindowId != "" {
		// Find workspace ID for this window
		windowFound := false
		for _, ws := range workspaces {
			if ws.WindowId == blocksWindowId {
				workspaceIdsToQuery = []string{ws.WorkspaceData.OID}
				windowFound = true
				break
			}
		}
		if !windowFound {
			return fmt.Errorf("window %s not found", blocksWindowId)
		}
	} else {
		// Default to all workspaces

View on GitHub (pinned to a4447c1563)

Solutions

  1. Remove either --workspace or --window, keeping only the scope you want
  2. In scripts, pass only the flag whose ID you resolved, e.g. build the command conditionally
  3. Use --window when you know the window id and --workspace when you know the workspace id, never both

Example fix

// before
wsh blocks list --workspace $WS --window $WIN
// after
wsh blocks list --workspace $WS
Defensive patterns

Strategy: validation

Validate before calling

if workspaceId != "" && windowId != "" {
    return fmt.Errorf("pass either --workspace or --window, not both")
}

Try / catch

if err := runBlocksList(); err != nil && strings.Contains(err.Error(), "mutually exclusive") {
    // drop one flag and rerun
}

Prevention

When it happens

Trigger: Invoking `wsh blocks list --workspace <id> --window <id>` — both non-empty flag values trigger the mutually-exclusive check.

Common situations: Script templates that always pass both flags (one possibly filled with a stale/default value); users unaware only one scope may be given; shell aliases appending flags.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/15fd4e8af0a8edeb. Report an issue: GitHub.