Interface IPluginHost
Host interface provided to plugins for interacting with wtmux.
public interface IPluginHost
Properties
Config
Gets the current configuration.
WtmuxConfig Config { get; }
Property Value
- WtmuxConfig
Methods
BindKey(byte, string)
Registers a key binding. The action receives the key byte.
void BindKey(byte key, string command)
Parameters
keybytecommandstring
BindMouse(string, string)
Binds a named mouse key (e.g. WheelUpPane) to a command. Unknown names are ignored.
void BindMouse(string mouseKey, string command)
Parameters
mouseKeystringcommandstring
BindRootKey(byte, string)
Binds a key in the root (no-prefix) key table.
void BindRootKey(byte key, string command)
Parameters
keybytecommandstring
GetUserOption(string)
Gets the value of a tmux-style user option (@name), or an empty string when unset.
Plugins set user options via SetOption(string, string) (e.g. SetOption("@my_plugin_theme", "dark")).
string GetUserOption(string name)
Parameters
namestring
Returns
- string
Log(string)
Logs a message for debugging.
void Log(string message)
Parameters
messagestring
OnSessionCreated(Action<SessionEventArgs>)
Registers a handler called when a session is created.
void OnSessionCreated(Action<SessionEventArgs> handler)
Parameters
handlerAction<SessionEventArgs>
OnSessionEnded(Action<SessionEventArgs>)
Registers a handler called when a session ends.
void OnSessionEnded(Action<SessionEventArgs> handler)
Parameters
handlerAction<SessionEventArgs>
RegisterFormatVariable(string, Func<FormatContext, string>)
Registers a custom status bar format variable. When #{name} is encountered in format strings, the provider is called.
void RegisterFormatVariable(string name, Func<FormatContext, string> provider)
Parameters
namestringproviderFunc<FormatContext, string>
RunCommand(string)
Executes a wtmux command in the server's global context (there is no attached client).
Client-independent commands work — global option changes (set-option -g), config
commands (source-file, reload-config), key bindings (bind, unbind),
and queries (show-option). Commands that act on the current client/session
(e.g. new-window, split-window, display-message, send-keys)
are not supported from this context and return a failure. Returns the command's success
state and any textual output.
PluginCommandResult RunCommand(string command)
Parameters
commandstring
Returns
SetOption(string, string)
Sets a configuration option.
void SetOption(string option, string value)
Parameters
optionstringvaluestring
UnbindKey(byte)
Removes a key binding.
void UnbindKey(byte key)
Parameters
keybyte
UnbindMouse(string)
Removes a mouse-key binding (and suppresses its built-in default).
void UnbindMouse(string mouseKey)
Parameters
mouseKeystring
UnbindRootKey(byte)
Removes a root-table key binding.
void UnbindRootKey(byte key)
Parameters
keybyte