All Development and update is now done in txm new repository and now using Go as a development language. This is now archived
txm
is a command-line utility to make working with tmux more efficient and user-friendly. It's written in Python and aims to abstract some of the complexities involved in managing tmux sessions, panes, and command executions.
You can install the package from PyPI using pip
:
pip install txm
To build txm
from the source first clone the repository
git clone https://github.com/MohamedElashri/txm
Now navigate to the root directory of the project and execute the following command:
cd txm
pip install .
Here are the available functionalities of txm
.
To create a new session, run:
txm new [SESSION_NAME]
To list all available sessions, run:
txm list
To attach to an existing session, run:
txm attach [SESSION_NAME]
To detach from the current session, run:
txm detach
To split the current pane vertically, run:
txm vsplit
To split the current pane horizontally, run:
txm hsplit
To navigate between panes, run:
txm navigate [DIRECTION]
DIRECTION
can be one of the following: U
for up, D
for down, L
for left, R
for right.
To execute a command in the current pane, run:
txm run [COMMAND]
txm
can optionally read from a .txm-config.json
file located in the root directory for user-specific settings.
This configuration file contains settings and preferences for your TXM utility. It should be placed in the root directory of your project or your home directory.
Default Template:
{
"tmux_path": "/usr/local/bin/tmux",
"log_directory": "logs/",
"default_session_name": "my_session"
}
- tmux_path: Specifies the path to the tmux executable.
- log_directory: Specifies the directory where tmux pane logs will be saved.
- default_session_name: Specifies the default name for a new tmux session.
This file holds the saved tmux session presets. It will be automatically generated by the txm save
command, or you can create it manually in the directory of your choice.
Default Template:
{
"presets": [
{
"name": "preset_1",
"windows": [
{
"name": "window_1",
"panes": ["command1", "command2"]
},
{
"name": "window_2",
"panes": ["command3", "command4"]
}
]
}
]
}
- name: Specifies the name of the saved preset.
- windows: Array of windows in the preset.
- name: Name of the window.
- panes: Array of commands to run in each pane.
Contributions are welcome. Feel free to open a pull request or submit an issue.
This project is licensed under the MIT License. See the LICENSE.md file for details.