- Notifications
You must be signed in to change notification settings - Fork231
🖥️ Session manager for tmux, built on libtmux.
License
tmux-python/tmuxp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Session manager for tmux, which allows users to save and load tmux sessions through simple configuration files. Powered bylibtmux.
New to tmux?The Tao of tmuxis available on Leanpub andAmazon Kindle.Read and browse the book for freeon theweb.
Have some spare time? Help us triage and code review and the tracker. Seeissue#290!
pip:
$pip install --user tmuxp
Homebrew:
$brew install tmuxp
Debian / ubuntu:
$sudo apt install tmuxp
Nix:
$[[-z$(which tmux) ]]&& (nix-env -i tmux&& nix-env -i tmuxp)|| nix-env -i tmuxp
Find the package for your distro on repology:https://repology.org/project/tmuxp/versions
Developmental releases:
pip:
pip install --user --upgrade --pre tmuxp
pipx:
pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force
Then use
tmuxp@next load [session]
.
Load tmux sessions via json and YAML,tmuxinator andteamocil style.
session_name:4-pane-splitwindows: -window_name:dev windowlayout:tiledshell_command_before: -cd ~/# run as a first command in all panespanes: -shell_command:# pane no. 1 -cd /var/log# run multiple commands in this pane -ls -al | grep \.log -echo second pane# pane no. 2 -echo third pane# pane no. 3 -echo fourth pane# pane no. 4
Save asmysession.yaml, and load:
tmuxp load ./mysession.yaml
Projects with.tmuxp.yaml or.tmuxp.json load via directory:
tmuxp load path/to/my/project/
Load multiple at once (in bg, offer to attach last):
tmuxp load mysession ./another/project/
Name a session:
tmuxp load -s session_name ./mysession.yaml
simple andveryelaborateconfig examples
tmuxp checks for configs in user directories:
$TMUXP_CONFIGDIR
, if set$XDG_CONFIG_HOME
, usually$HOME/.config/tmuxp/$HOME/.tmuxp/
Load your tmuxp config from anywhere by using the filename, assuming~/.config/tmuxp/mysession.yaml (or.json):
$tmuxp load mysession
Seeauthor's tmuxp configs andthe projects'tmuxp.yaml.
New in 1.6.0:
tmuxp shell
launches into a python console preloaded with the attachedserver, session, and window inlibtmux objects.
$tmuxp shell(Pdb) server<libtmux.server.Server object at 0x7f7dc8e69d10>(Pdb) server.sessions[Session($1 your_project)](Pdb) sessionSession($1 your_project)(Pdb) session.name'your_project'(Pdb) windowWindow(@3 1:your_window, Session($1 your_project))(Pdb) window.name'your_window'(Pdb) window.panes[Pane(%6 Window(@3 1:your_window, Session($1 your_project)))(Pdb) panePane(%6 Window(@3 1:your_window, Session($1 your_project))
SupportsPEP553breakpoint()
(includingPYTHONBREAKPOINT
). Also supports direct commands via-c
:
$tmuxp shell -c'print(window.name)'my_window$tmuxp shell -c'print(window.name.upper())'MY_WINDOW
Read more ontmuxp shell inthe CLI docs.
Run custom startup scripts (such as installing project dependenciesbefore loading tmux. See thebootstrap_env.pyandbefore_scriptexample
You can also load sessions in the background by passing-d
flag
Snapshot your tmux layout, pane paths, and window/session names.
$tmuxp freeze session-name
See more aboutfreezingtmux sessions.
Convert a session file from yaml to json and vice versa.
$tmuxp convert filename
This will prompt you for confirmation and shows you the new file that isgoing to be written.
You can auto confirm the prompt. In this case no preview will be shown.
$tmuxp convert -y filename$tmuxp convert --yes filename
tmuxp has a plugin system to allow for custom behavior. See more aboutthePlugin System.
Theload
command provides a way to log output to a log file fordebugging purposes.
$tmuxp load --log-file<log-file-name>.
Collect system info to submit with a Github issue:
$tmuxp debug-info------------------environment: system: Linux arch: x86_64#... so on
See theQuickstart.
Documentation homepage (also in中文)
Want to learn more about tmux itself?Read The Tao of Tmuxonline.
Your donations fund development of new features, testing and support.Your money will go directly to maintenance and development of theproject. If you are an individual, feel free to give whatever feelsright for the value you get out of the project.
See donation options athttps://tony.sh/support.html.
- tmux support: 1.8+
- python support: >= 3.9, pypy, pypy3
- Source:https://github.com/tmux-python/tmuxp
- Docs:https://tmuxp.git-pull.com
- API:https://tmuxp.git-pull.com/api.html
- Changelog:https://tmuxp.git-pull.com/history.html
- Issues:https://github.com/tmux-python/tmuxp/issues
- Test Coverage:https://codecov.io/gh/tmux-python/tmuxp
- pypi:https://pypi.python.org/pypi/tmuxp
- Open Hub:https://www.openhub.net/p/tmuxp-python
- Repology:https://repology.org/project/tmuxp/versions
- License:MIT.
About
🖥️ Session manager for tmux, built on libtmux.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.