screen:index
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| screen:index [2018/09/21 08:45] – [TMUX Tips] orel | screen:index [2024/03/18 15:06] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| Kill a remote screen session | Kill a remote screen session | ||
| $ screen -S sessionid -X quit | $ screen -S sessionid -X quit | ||
| + | |||
| + | Launch several commands in several windows, but in the same session: | ||
| + | |||
| + | $ screen -S sessionid -t win1 -A -d -m bash | ||
| + | $ screen -S sessionid -X screen -t win2 -A -d -m bash | ||
| + | $ screen -ls sessionid | ||
| + | | ||
| + | Reattach all windows (use " | ||
| + | |||
| + | $ screen -r sessionid | ||
| + | |||
| + | |||
| + | Reattach a given window: ??? | ||
| + | |||
| + | Shortcuts: | ||
| + | |||
| + | * Ctrl+a d : detach | ||
| + | * ... | ||
| + | |||
| + | |||
| ===== TMUX Tips ===== | ===== TMUX Tips ===== | ||
| Line 35: | Line 55: | ||
| Start another window in this session: | Start another window in this session: | ||
| - | $ tmux new-window -t sessionid -n win1 bash | + | $ tmux new-window -t sessionid -n win1 bash |
| List windows and panes: | List windows and panes: | ||
| Line 43: | Line 63: | ||
| $ tmux list-panes -t sessionid: | $ tmux list-panes -t sessionid: | ||
| | | ||
| - | Attach session to the end user's terminal (tmux in foreground): | + | Attach session to the end user's terminal (tmux in foreground). Then, you can get multiple displays of a session: |
| $ tmux attach-session -t sessionid | $ tmux attach-session -t sessionid | ||
| | | ||
| - | Join / Break windows | + | Enable mouse (useful to switch |
| - | $ tmux join -t qemunet:0 # ??? | + | $ tmux set-option |
| - | $ tmux break ... | + | |
| + | Moving a source pane into a target window: | ||
| + | |||
| + | $ tmux list-panes -a | ||
| + | pouet:0.0: ... | ||
| + | pouet:1.0: ... <- current one | ||
| + | |||
| + | | ||
| + | $ tmux join-pane -t pouet:0 | ||
| + | |||
| + | $ tmux list-panes -a | ||
| + | pouet:0.0: ... | ||
| + | pouet:0.1: ... <- current one | ||
| + | |||
| + | In order to reverse the ' | ||
| + | |||
| + | $ tmux list-panes -a | ||
| + | pouet:0.0: ... | ||
| + | pouet:0.1: ... <- current one | ||
| + | |||
| + | $ tmux break-pane # break src pane off its current window | ||
| + | |||
| + | $ tmux list-panes -a | ||
| + | pouet:0.0: ... | ||
| + | pouet:1.0: ... <- current one | ||
| + | |||
| + | Instead of moving an existing pane, you can use ' | ||
| + | |||
| + | $ tmux list-panes -a | ||
| + | pouet:0.0: ... | ||
| + | pouet:1.0: ... <- current one | ||
| + | |||
| + | $ tmux split-window | ||
| + | |||
| + | $ tmux list-panes -a | ||
| + | pouet:0.0: ... | ||
| + | pouet:1.0: ... | ||
| + | pouet:1.1: ... <- current one | ||
| + | |||
| + | |||
| + | If you want to reverse the prevous | ||
| + | |||
| + | $ tmux break-pane | ||
| Kill session: | Kill session: | ||
| Line 56: | Line 118: | ||
| $ tmux kill-session -t sessionid | $ tmux kill-session -t sessionid | ||
| + | Link a window/pane in another session (multiple display): | ||
| - | Pipe a pane: | + | $ tmux new-session -s pouet1 |
| + | $ tmux new-session -s pouet2 | ||
| + | $ tmux list-panes -a | ||
| + | pouet1:0.0: ... %0 (active) | ||
| + | pouet2:0.0: ... %1 (active) | ||
| + | $ tmux link-window -s pouet1:0.0 -t pouet2 | ||
| + | $ tmux list-panes -a | ||
| + | pouet1:0.0: ... %0 (active) | ||
| + | pouet2:0.0: ... %1 (active) | ||
| + | pouet2:0.0: ... %0 (active) | ||
| + | |||
| + | ==== Useful Shortcuts ==== | ||
| - | | + | |
| - | | + | * ctrl-b w => list windows and select it |
| - | | + | * ctrl-b n => next window |
| + | * ctrl-b p => previous window | ||
| + | | ||
| + | | ||
| + | * ctrl-b c => new shell window | ||
| + | * ctrl-b x => kill current pane | ||
| - | # In a second terminal | + | I use to rebind 'ctrl-b x' |
| - | $ rm -f / | + | |
| - | $ tmux pipe-pane -t sessionid: | + | |
| - | $ cat / | + | |
| - | # ... | + | |
| - | $ tmux pipe-pane -t sessionid:0.0 -I -o 'cat < / | + | |
| - | $ echo coucou > / | + | |
| - | Configure your session: | + | tmux bind-key x kill-session |
| - | $ tmux set-option -t sessionid -g default-shell / | + | |
| - | # enable | + | If you want to list current |
| - | $ tmux set-option -t sessionid -g mouse on | + | |
| - | | + | tmux ls |
| - | | + | |
| - | | + | If you want to (re-)attach your session |
| - | | + | |
| - | $ tmux set-option -g status-right '# | + | tmux a |
| + | |||
| + | If you want to kill all... | ||
| + | tmux kill-server | ||
| + | Enjoy! | ||
screen/index.1537519553.txt.gz · Last modified: 2024/03/18 15:05 (external edit)
