Skip to content

Open an editor

POST
/api/panes/{pane_id}/open-editor
Code sample: Shell / cURL
curl --request POST \
--url http://127.0.0.1:8004/api/panes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/open-editor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "path": "example", "line": 1, "editor": "native" }'

Opens path, if given, in editor (else the editor setting) and shows that editor over the pane in every client.

pane_id
required
string format: uuid

Pane ID

Media typeapplication/json
object
path

The file to open; without one, the editor is just shown.

string | null
line
integer | null format: int64
<= 4294967295
editor
One of:

Overrides the editor setting.

string
Allowed values: native pane neovim vscode

Whether it opened; with the pane editor it doesn’t, and the caller runs $EDITOR itself, as btmux open-editor does

Media typeapplication/json
object
opened
required

False when the caller should run $EDITOR itself.

boolean

Example generated

{
"opened": true
}

A malformed ID or JSON body

Media typetext/plain
string

Missing or wrong access token

Media typetext/plain
string

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 pane, or the native editor can’t open the file

Media typetext/plain
string

A body over the size limit

Media typetext/plain
string

No Content-Type: application/json

Media typetext/plain
string

A body that doesn’t match its schema

Media typetext/plain
string

The built-in Neovim couldn’t open the file

Media typetext/plain
string