HTMLShell
Runs any *.shell.html file in a panel.
Relative src=/href= resolve to files in the target's own folder
(<script src="script.js">, css, images). Only that folder is reachable;
remote origins are blocked. vsc holds the page's one VS Code api handle:
do not call acquireVsCodeApi() in target code.
Use
HTMLShell: Run. The target loads sandboxed with one global, vsc:
// fire a command in the integrated terminal
let r = await vsc.run('deploy myapp myapp.example.com 203.0.113.10')
// wait boolean, default true; false = don't wait if terminal busy, return busy:true instead
// r.ok true | false | null (null = degraded)
// r.exitCode number | null
// r.stdout string | null, stdout+stderr merged, exact bytes from a tee file
// r.degraded true = no shell integration; command ran, status unknown
// r.busy true = wait was false and terminal was busy, command never ran
// open a file or folder in the editor, no shell
let o = await vsc.open('/path/to/project')
// file: opens/focuses an editor tab
// directory: adds as a workspace root unless it is (or is inside) one already, reveals it in Explorer
// o.ok true | false, o.error string | null, o.path absolute path this result is for
// add a folder as a workspace root without pulling Explorer focus to it
let a = await vsc.addFolder('/path/to/project')
// same result shape as vsc.open; a directory that is (or is inside) a root already is a no-op
Right-click anywhere in the panel: Inspect Element opens the webview's Chromium
devtools and logs the clicked DOM node to its console (click the node -> Elements
panel). HTMLShell: Open DevTools (title bar / context menu) opens them plain.
Desktop VS Code only; in a browser client use F12.