editor.*
Editor panes are a non-PTY surface kind (editor: ids). See
file explorer & editor and the
ht edit / ht editor CLI.
| Method | Params | Result |
|---|---|---|
editor.open | { path?, cwd?, create?, split?, direction? } | "OK" |
editor.split | { path?, cwd?, create?, direction? } | "OK" |
editor.list | {} | { editors: string[] } — editor surface ids in the active workspace |
editor.save | { surface_id? } | "OK" |
editor.reload | { surface_id? } | "OK" |
editor.close | { surface_id? } | "OK" |
Params
path— file to open. Omitted opens a blank buffer.cwd— base directory used to resolve a relativepath.create— create the file when it does not exist (acceptstrueor"true").split(editor.openonly) — open beside the focused pane instead of in a new workspace.direction—"right"/"horizontal"(default) or"down"/"vertical".surface_id— target editor pane. Also accepted assurfaceIdorid. Defaults to the focused surface; the call throws unless the resolved id is an editor surface.
Saving is also bound to ⌘S inside the pane; editor.save is the
scriptable equivalent.