Create a window
curl --request POST \ --url http://127.0.0.1:8004/api/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/windows \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "cwd": "example", "select": true, "command": { "exec": [ "example" ] }, "env": {}, "keep_open": true }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Session ID
Request Bodyrequired
Section titled “Request Bodyrequired”object
Make it the active window.
Run this instead of the shell, starting now rather than once a client
shows the pane. The pane closes when it exits, unless keep_open.
A program and its arguments.
object
A program and its arguments.
A command line for the pane’s shell.
object
A command line for the pane’s shell.
object
Keep the pane, with its output, after its program exits.
Responses
Section titled “Responses”The new window’s first pane
object
The new pane as GET /api/panes lists it, as it was created.
object
Layout order, as prefix + q numbers panes.
Its program exited; only a pane created with keep_open stays.
The program’s exit status, 128 + N if signal N ended it.
Example generated
{ "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pane_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pane": { "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "session_name": "example", "window_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "window_index": 1, "window_name": "example", "window_active": true, "window_zoomed_flag": true, "pane_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pane_index": 1, "pane_active": true, "pane_current_path": "example", "pane_title": "example", "pane_dead": true, "pane_dead_status": 1 }}An empty command, env without one, or with a command a cwd that isn’t a directory; or a malformed ID or JSON body
Missing or wrong access token
The request’s Host or Origin isn’t allowed, or the caller can’t use this route (a guest token, or btmux connect)
No such session
A body over the size limit
No Content-Type: application/json
The command can’t start; or a body that doesn’t match its schema