Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-swift latest

Server.hasSession(_:)

Whether a session by this name or id exists.

Source and package
Qualified name
Server.hasSession(_:)
Declared in
Server
Package
libtmux-swift
Source
Sources/LibTmux/Server.swift
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp Python Ruby Lua TypeScriptRustGoJavaC# C++ Kotlin Scala OCaml F# Clojure
hasSession(name: String) -> Bool

Description#

Lists sessions and compares in Swift rather than asking has-session to resolve the name: a plain -t name reads an unambiguous abbreviation as a match, so -t alpha answers yes for a session named only alphabet, and -t =name answers no for one whose real name holds . or :. Neither target spelling is both exact and universal; listing first and comparing by value is. Checking isRunning() first keeps this false rather than thrown for a server that is not there yet or just went away -- sessions() itself throws on that, unlike the has-session this replaces.

Parameters
Raises

Guides#

Pages that discuss hasSession(_:).

In other ports#

Whether a session with this name exists

Equivalents of Whether a session with this name exists in other languages
Language Equivalent
Python libtmux.Server.has_session
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript server.Server.hasSession
Rust server.Server.has_session
Go tmux.Server.HasSession
Java io.github.libtmux.Server.hasSession
C# LibTmux.Server.HasSessionAsync
C++ no equivalent on Server
OCaml No direct public OCaml equivalent is recorded for this operation.
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference