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.sourceFile

Run a tmux config file against this server.

Source and package
Qualified name
Server.sourceFile
Module
server
Declared in
Server
Package
libtmux
Source
packages/libtmux/src/server.ts
Other languages
PowerShell Julia Elixir PythonRuby Lua RustGoJavaC#C++Swift Kotlin Scala F#
sourceFile(path: string): Promise<void>

Description#

tmux does not expand ~ here. source-file joins a path that is not absolute to the client's working directory and globs the result, so "~/.tmux.conf" looks for a directory literally named ~. Typing it at a shell works because the shell expands it first; passing it as a string never does.

Examples#

await server.sourceFile(`${process.env["HOME"] ?? "."}/.tmux.conf`);
Parameters

tmux command#

The tmux commands behind sourceFile.

tmux C API#

The C declarations in tmux that implement these commands.

In other ports#

Load a tmux configuration file

Equivalents of Load a tmux configuration file in other languages
Language Equivalent
Python libtmux.Server.source_file
Ruby LibTmux::Server#source_file
Rust server.Server.source_file
Go tmux.Server.SourceFile
Java io.github.libtmux.Server.sourceFile
C# LibTmux.Server.SourceFileAsync
C++ libtmux::Server::source_file
Swift Server.sourceFile(_:)

No equivalent is recorded in Lua, PowerShell, Julia, Elixir, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference