libtmux Reference MCP Search
On this page

server.Server.hasSession

View as Markdown

Module
server
Declared in
Server
Package
@libtmux/libtmux
Source
packages/libtmux/src/server.ts
hasSession ( name : : string ) Promise<boolean>
method [source]
method [source]
hasSession

Whether a session with this name exists.

The name is matched exactly. tmux normally accepts a unique prefix as a session target, which would make checking work answer yes for workspace; this method does not.

Examples

if (!(await server.hasSession("work"))) {
  await server.newSession({ name: "work" });
}

0 declared, 0 inherited

Esc

Type to search.