wavetermdev/waveterm · error
no WAVETERM_TABID env var set
Error message
no WAVETERM_TABID env var set
What it means
wsh wavepath runs inside the Wave terminal environment and derives the target tab from the WAVETERM_TABID env var, which the terminal injects into wsh subprocesses. If it is empty, wavepathRun cannot resolve which tab's path to request and fails before issuing the RPC.
Source
Thrown at cmd/wsh/cmd/wshcmd-wavepath.go:61
}
pathType := args[0]
if pathType != "config" && pathType != "data" && pathType != "log" {
OutputHelpMessage(cmd)
return fmt.Errorf("invalid path type %q. must be one of: config, data, log", pathType)
}
tail, _ := cmd.Flags().GetBool("tail")
if tail && pathType != "log" {
return fmt.Errorf("--tail can only be used with the log path type")
}
open, _ := cmd.Flags().GetBool("open")
openExternal, _ := cmd.Flags().GetBool("open-external")
tabId := getTabIdFromEnv()
if tabId == "" {
return fmt.Errorf("no WAVETERM_TABID env var set")
}
path, err := wshclient.PathCommand(RpcClient, wshrpc.PathCommandData{
PathType: pathType,
Open: open,
OpenExternal: openExternal,
TabId: tabId,
}, nil)
if err != nil {
return fmt.Errorf("getting path: %w", err)
}
if tail && pathType == "log" {
err = tailLogFile(path)
if err != nil {
return fmt.Errorf("tailing log file: %w", err)
}
return nilView on GitHub (pinned to a4447c1563)
Solutions
- Run the command from a shell spawned inside Wave Terminal so WAVETERM_TABID is set.
- Verify with `echo $WAVETERM_TABID`; if empty, relaunch the shell from within Wave.
- Explicitly export WAVETERM_TABID=<tabid> for headless/scripted use.
Example fix
// before (plain shell) wsh wavepath log // after export WAVETERM_TABID=<tab-id> wsh wavepath log
Defensive patterns
Strategy: validation
Validate before calling
if [ -z "$WAVETERM_TABID" ]; then echo "run inside Wave Terminal or export WAVETERM_TABID" >&2; exit 1; fi
Try / catch
if err := runWavepath(); err != nil { if strings.Contains(err.Error(), "WAVETERM_TABID") { fallbackToNonTabPath() } else { return err } } Prevention
- Run wsh commands from shells spawned inside Wave Terminal.
- Assert WAVETERM_TABID is set in CI/script preambles.
- Don't unset Wave-injected env vars in wrapper scripts.
When it happens
Trigger: Running `wsh wavepath ...` outside a Wave terminal (plain shell, CI, SSH session, editor terminal launched before Wave env was loaded) or with WAVETERM_TABID explicitly unset/emptied.
Common situations: Running wsh from bash/zsh started independently of Wave, Docker containers, cron jobs, or after `env -i` / `unset WAVETERM_TABID` in scripts.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- no files or message provided
- too many files (maximum %d files allowed)
- stdin (-) can only be used once
- WAVETERM_TABID environment variable not set
- resolving block: %v
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/c2caa39611059130.
Report an issue: GitHub.