execute_js
Execute JavaScript code in any Tabby terminal tab and return the result. Code runs with fresh scope and async support.
Instructions
Execute JavaScript code in Tabby terminal context and return the result. Code is wrapped in async IIFE by default for fresh scope and await support.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Target tab: index (0=first, -1=last) or WebSocket URL from list_targets | |
| code | Yes | JavaScript code to execute. Use 'return' to return values. | |
| wrap | No | Wrap code in async IIFE for fresh scope + await support. Set to false for raw execution (e.g., defining globals). |