Skip to content

Commit

Permalink
Create tmux.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lazysegtree authored Jan 29, 2025
1 parent 771a0ee commit aab5efd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions testsuite/docs/tmux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Overview
This is to document the behviour of tmux, and how could use it in testsuite

# Tmux concepts and working info
- Tmux creates a main server process, and one new process for each session.
<img width="1147" alt="image" src="https://github.com/user-attachments/assets/c701a56f-49ef-43a2-9b76-8f613f5e219a" />
- `-s` and `-n` for window naming.
- We have prefix keys to send commands to tmux.

# Sample usage with spf

## Sending keys to termux and controlling from outside.
<img width="1147" alt="image" src="https://github.com/user-attachments/assets/8ca67e0c-ece6-465c-84b1-755c8fa0a67e" />
<img width="1147" alt="image" src="https://github.com/user-attachments/assets/e4aeb0b9-e184-41a0-89eb-9174082eb884" />

# Knowledge sharing
- `tmux new 'spf'` - Run spf in tmux
- `tmux attach -t <session_name>` attach to an existing session. You can have two windows duplicating same behaviour.
- `tmux kill-session -t <session_name>` kill session
- `Ctrl+B`+`:` - Enter commands
- `Ctrl+B`+`D` - Detach from session
- `:source ~/.tmux.conf` - Change the config of running server
- We have already a wrapper libary for termux in python !!!!!
- How to send key press/tmux commands to the process ?


# References
- https://github.com/tmux/tmux/wiki/Getting-Started
- https://tao-of-tmux.readthedocs.io/en/latest/manuscript/10-scripting.html#controlling-tmux-send-keys
- https://github.com/tmux-python/libtmux

0 comments on commit aab5efd

Please sign in to comment.