tmux
The community/apps/tmux
directory contains files to enable Talon voice control of tmux
. It provides commands for controlling tmux
sessions, windows, and panes.
The core functionality is defined in these files:
-
tmux.talon
: This file contains Talon commands for pane management, using theuser.splits
anduser.tabs
tags. It also contains a note about a required configuration file for detecting whentmux
is active. The commands in this file rely on actions defined intmux.py
. For example,go split <user.arrow_key>
will use theuser.tmux_keybind
action to send the appropriate keys to move between panes, whilego split
will display the panes. -
tmux.py
: This file defines the core Python logic fortmux
control. It sets up thetmux
app context, and defines the actions that are used by the commands intmux.talon
andtmux_linux.talon
. These actions include:tmux_prefix
: Sends thetmux
prefix key (defaultctrl-b
).tmux_keybind
: Sends the prefix key followed by another key.tmux_enter_command
: Enterstmux
command mode, and optionally enters a command (without executing it).tmux_execute_command
: Enterstmux
command mode, enters a command and executes it.tmux_execute_command_with_confirmation
: Executes atmux
command that requires confirmation.- Overrides of
app.tab_open
,app.tab_next
, andapp.tab_previous
, to controltmux
windows as though they were tabs. - Overrides of
user
actions to controltmux
splits and switch between panes. For example,split_window_right
creates a split to the right, and then swaps the new pane to the bottom of the pane stack, effectively moving it to the right of the active pane.
-
tmux_linux.talon
: This file defines commands for Linux that use a more traditional method for controllingtmux
using direct keybinds andtmux
commands. It provides amux
command prefix which can be used to execute a variety oftmux
actions, such as creating new sessions or windows, switching between panes, renaming sessions, or killing windows or panes. Themux
command prefix also has variations that insert the equivalenttmux
command into the terminal rather than sending keybinds. For example,mux new session
insertstmux new
into the terminal, so that the user can enter the rest of the command.
The tmux.py
file defines a context which applies only when the active app is tmux
. This allows overriding the default actions defined in Talon (for example, the behavior of tab switching). The tmux.talon
file provides a basic set of commands for controlling panes, while the tmux_linux.talon
provides a more comprehensive set of commands for controlling all aspects of tmux
when running on Linux. All of the commands in these .talon
files rely on the actions defined in tmux.py
.
In summary, these files provide a comprehensive set of tools for controlling tmux
with Talon. They provide basic pane control, tab control, and session control functionality. The tmux.py
file is the most important, as it defines the underlying actions for all of the commands.