-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
771a0ee
commit aab5efd
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |