wavetermdev/waveterm · error
block %s is not a terminal block (view type: %s)
Error message
block %s is not a terminal block (view type: %s)
What it means
After fetching block metadata, wsh validates that the block's meta[MetaKey_View] equals "term". If the key is missing or any non-"term" value (e.g. "preview", "web"), it refuses to fetch scrollback with this error.
Source
Thrown at cmd/wsh/cmd/wshcmd-termscrollback.go:68
// Resolve the block argument
fullORef, err := resolveBlockArg()
if err != nil {
return err
}
// Get block metadata to verify it's a terminal block
metaData, err := wshclient.GetMetaCommand(RpcClient, wshrpc.CommandGetMetaData{
ORef: *fullORef,
}, &wshrpc.RpcOpts{Timeout: 2000})
if err != nil {
return fmt.Errorf("error getting block metadata: %w", err)
}
// Check if the block is a terminal block
viewType, ok := metaData[waveobj.MetaKey_View].(string)
if !ok || viewType != "term" {
return fmt.Errorf("block %s is not a terminal block (view type: %s)", fullORef.OID, viewType)
}
// Make the RPC call to get scrollback
scrollbackData := wshrpc.CommandTermGetScrollbackLinesData{
LineStart: termScrollbackLineStart,
LineEnd: termScrollbackLineEnd,
LastCommand: termScrollbackLastCmd,
}
result, err := wshclient.TermGetScrollbackLinesCommand(RpcClient, scrollbackData, &wshrpc.RpcOpts{
Route: wshutil.MakeFeBlockRouteId(fullORef.OID),
Timeout: 5000,
})
if err != nil {
return fmt.Errorf("error getting terminal scrollback: %w", err)
}
// Format the outputView on GitHub (pinned to a4447c1563)
Solutions
- Target a terminal block: get the correct OID from the Wave UI block menu.
- Check the block's meta with `wsh getmeta <oid>` and confirm view == "term".
- If the block should be a terminal but isn't, fix its meta (`wsh setmeta <oid> view:term`).
Defensive patterns
Strategy: type-guard
Validate before calling
meta, _ := wshclient.GetMetaCommand(RpcClient, wshrpc.CommandGetMetaData{ORef: *fullORef}, nil)
if v, _ := meta[waveobj.MetaKey_View].(string); v != "term" {
fmt.Fprintf(os.Stderr, "block %s is not a terminal block\n", fullORef.OID)
os.Exit(1)
} Type guard
func isTerminalBlock(meta map[string]any) bool {
v, ok := meta[waveobj.MetaKey_View].(string)
return ok && v == "term"
} Try / catch
viewType, ok := metaData[waveobj.MetaKey_View].(string)
if !ok || viewType != "term" {
// handle non-terminal block: exit gracefully or prompt for a different OID
} Prevention
- Verify view type with `wsh getmeta <oid>` before fetching scrollback.
- Only pass OIDs sourced from terminal blocks.
- If scripting, filter block lists by meta view == "term" first.
When it happens
Trigger: `wsh termescrollback <oid>` on a block whose view type is not a terminal — passing a preview/editor/web block OID, or a typo'd OID that resolves to the wrong block.
Common situations: Copying an OID from the wrong block; pointing the command at a config or file block; a block whose meta was changed so the view key no longer reads "term".
Related errors
- badge oref must be a block or tab (got %q)
- unknown --view %q; try one of: term, web, preview, edit, sys
- --workspace and --window are mutually exclusive; specify onl
- cannot parse connection name: %w
- --conn parameter is required
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/d5d96f981d4921dd.
Report an issue: GitHub.