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-ts latest

Server.versionAtLeast

Whether this server is at least minimum, written the way tmux writes it.

Source and package
Qualified name
Server.versionAtLeast
Module
server
Declared in
Server
Package
libtmux
Source
packages/libtmux/src/server.ts
async versionAtLeast(minimum: string): Promise<boolean>

Description#

This is how a caller gates on a feature that arrived in a known release without parsing #{version} themselves. A named development build such as next-3.9 has not shipped the release it names: it is at least 3.8, but not at least 3.9. A candidate such as X.Y-rcN ranks the same way, below X.Y and above the release before it. minimum must be a form tmux prints, such as 3.7a, or the call throws a TypeError.

Examples#

if (await server.versionAtLeast("3.5")) {
await server.setHook("command-error", "display-message 'a command failed'");
}
Parameters
Esc

Type to search.

Reference previewOpen reference