wavetermdev/waveterm · error

No tab view found for the given webContents id

Error message

No tab view found for the given webContents id

What it means

GetDistro iterates the WSL distributions registered on the Windows host and returns the one whose name matches the given wslDistroName. If the loop finishes without a match, it returns this error. It means the requested distro name is not registered in WSL (`wsl -l -v` would not list it).

Source

Thrown at emain/emain-ipc.ts:272

    electron.ipcMain.on("get-cursor-point", (event) => {
        const tabView = getWaveTabViewByWebContentsId(event.sender.id);
        if (tabView == null) {
            event.returnValue = null;
            return;
        }
        const screenPoint = electron.screen.getCursorScreenPoint();
        const windowRect = tabView.getBounds();
        const retVal: Electron.Point = {
            x: screenPoint.x - windowRect.x,
            y: screenPoint.y - windowRect.y,
        };
        event.returnValue = retVal;
    });

    electron.ipcMain.handle("capture-screenshot", async (event, rect) => {
        const tabView = getWaveTabViewByWebContentsId(event.sender.id);
        if (!tabView) {
            throw new Error("No tab view found for the given webContents id");
        }
        const image = await tabView.webContents.capturePage(rect);
        const base64String = image.toPNG().toString("base64");
        return `data:image/png;base64,${base64String}`;
    });

    electron.ipcMain.on("get-env", (event, varName) => {
        event.returnValue = process.env[varName] ?? null;
    });

    electron.ipcMain.on("get-about-modal-details", (event) => {
        event.returnValue = getWaveVersion() as AboutModalDetails;
    });

    electron.ipcMain.on("get-zoom-factor", (event) => {
        event.returnValue = event.sender.getZoomFactor();
    });

View on GitHub (pinned to a4447c1563)

Solutions

  1. Run `wsl -l -v` (or `wsl --list`) and use the exact distro name in the config
  2. Install the missing distro (`wsl --install -d <name>`)
  3. Fix or remove the stale connection entry referencing the old distro
  4. Check for exact-name/case mismatch (matching is by exact string equality)

Example fix

// before
conn := wslconn.GetDistro(ctx, "Ubuntu-22.04")
// after
// verify name first: run `wsl -l -v`, e.g. it lists "Ubuntu-22.04 LTS"
conn := wslconn.GetDistro(ctx, "Ubuntu-22.04") // use exact registered name
Defensive patterns

Strategy: validation

Validate before calling

out, err := exec.Command("wsl", "-l", "-v").Output()
if err == nil && !strings.Contains(strings.ToLower(string(out)), strings.ToLower(distroName)) {
    return fmt.Errorf("distro %q not registered in WSL; run wsl -l -v", distroName)
}

Try / catch

d, err := wslconn.GetDistro(ctx, name)
if err != nil {
    if strings.Contains(err.Error(), "not found") {
        // fall back to default distro or prompt user to install
    }
}

Prevention

When it happens

Trigger: Calling GetDistro with a Distro name that does not exactly match a registered WSL distribution's Name().

Common situations: Typo or case mismatch in the connection config's wslDistro value; distro was unregistered (`wsl --unregister`); distro not yet installed on the machine; stale saved connection pointing at an old distro name.

Related errors


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