-
-
Save umhan35/7ae497c3d75a28e9d36a88a99bee033f to your computer and use it in GitHub Desktop.
Revisions
-
michaellihs revised this gist
Sep 21, 2016 . 1 changed file with 22 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -68,20 +68,30 @@ Starting multiple commands in multiple panes Start a new tmux session with `tmux` before running the script! ``` sh # start a new tmux session and detach from it tmux new-session -d -s session1 tmux rename-window 'my window' tmux send-keys 'echo "pane 1"' C-m tmux select-window -t session1:0 tmux split-window -h tmux send-keys 'echo "pane 2"' C-m tmux split-window -h tmux send-keys 'echo "pane 3"' C-m # we want to have notifications in the status bar, if there are changes in the windows tmux setw -g monitor-activity on tmux set -g visual-activity on tmux select-layout even-horizontal # select the first window to be in the foreground tmux select-window -t session:1 # attach our terminal to the tmux session tmux -2 attach-session -t cflogs ``` -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -139,8 +139,10 @@ Further Resources * [tmuxinator](https://github.com/tmuxinator/tmuxinator) * [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058) * [tmux tutorial - part 1](http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/) * [tmux tutorial - part 2](http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/) * [Mouse support in OS X](http://www.davidverhasselt.com/enable-mouse-support-in-tmux-on-os-x/) * [(Video) Basic tmux Tutorial - Windows, Panes, and Sessions over SSH tutoriaLinux - Part 1](https://www.youtube.com/watch?v=BHhA_ZKjyxo) * [(Video) Basic tmux Tutorial, Part 2 -- Shared Sessions](https://www.youtube.com/watch?v=norO25P7xHg) * [tmux scripting - blog post](http://blog.htbaa.com/news/tmux-scripting) -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -141,5 +141,6 @@ Further Resources * [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058) * [tmux tutorial](http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/) * [Mouse support in OS X](http://www.davidverhasselt.com/enable-mouse-support-in-tmux-on-os-x/) * [(Video) Basic tmux Tutorial - Windows, Panes, and Sessions over SSH tutoriaLinux - Part 1](https://www.youtube.com/watch?v=BHhA_ZKjyxo) * [(Video) Basic tmux Tutorial, Part 2 -- Shared Sessions](https://www.youtube.com/watch?v=norO25P7xHg) -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,11 @@ tmux Cheat Sheet **Table of Contents** * [General Usage](#general-usage) * [Shortcuts](#shortcuts) * [Commands](#commands) * [Scripting tmux](#scripting-tmux) * [Configuring tmux](#configuring-tmux) * [Further Resources](#further-resources) -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -43,6 +43,18 @@ Shortcuts | ← | go to left pane | | ↑ | go to upper pane | | ↓ | go to lower pane | | | **Working with Sessions** | | `d` | detach from session | Commands ======== | Command | Description | | ------- | ----------- | | tmux -s <SESSION NAME> | creates a new session with name `<SESSION NAME>` | | tmux list-sessions | lists all currently running tmux sessions | | tmux attach -t <SESSION NAME> | attach to the session called `<SESSION NAME>` | Scripting TMUX -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -38,7 +38,7 @@ Shortcuts | `w` | list windows (and then select with arrow keys) | | | **Working with Panes** | | `%` | split window vertically | | `-` | split window horizontally <br> requires `bind - split-window -v` in our `.tmux.conf` | | → | go to right pane | | ← | go to left pane | | ↑ | go to upper pane | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -28,6 +28,7 @@ Shortcuts | :-----: | ----------- | | `CTRL`+`b` `<command>` | sends `<command>` to tmux instead of sending it to the shell | | | **General Commands** | | `?` | shows a list of all commands (`q`closes the list) | | `:` | enter a tmux command | | | **Working with Windows** | | `c` | creates a new window | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -87,7 +87,11 @@ Use set -g prefix C-a ``` to change the default prefix from `CTRL` + `b` to `CTRL` + `a`. Optionally you can "free" the default binding with ``` sh unbind C-b ``` Key Bindings -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -78,6 +78,18 @@ You can configure tmux via the `~/.tmux.conf` file. After making changes to the tmux source ~/.tmux.conf Changing the default prefix --------------------------- Use ``` sh set -g prefix C-a ``` to change the default prefix from `CTRL` + `b` to `CTRL` + `a` Key Bindings ------------ -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -83,7 +83,11 @@ Key Bindings You can add / alter tmux's key bindings with the following command ``` sh bind | split-window -h ``` this binds the `split window -h` command to the `|` key. Adding Mouse Support for Mac OS X -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,12 +9,26 @@ tmux Cheat Sheet * [Further Resources](#further-resources) General Usage ============= * Start a tmux session with ``` sh tmux ``` * Select text in a tmux window with your mouse by holding the `SHIFT` key (Windows) or the `OPTIONS` key (Mac) and then using the mouse as you'd normally do Shortcuts ========= | Key(s) | Description | | :-----: | ----------- | | `CTRL`+`b` `<command>` | sends `<command>` to tmux instead of sending it to the shell | | | **General Commands** | | `:` | enter a tmux command | | | **Working with Windows** | | `c` | creates a new window | | `,` | rename current window | @@ -64,6 +78,14 @@ You can configure tmux via the `~/.tmux.conf` file. After making changes to the tmux source ~/.tmux.conf Key Bindings ------------ You can add / alter tmux's key bindings with the following command Adding Mouse Support for Mac OS X --------------------------------- -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,9 +15,15 @@ Shortcuts | Key(s) | Description | | :-----: | ----------- | | `CTRL`+`b` `<command>` | sends `<command>` to tmux instead of sending it to the shell | | | **Working with Windows** | | `c` | creates a new window | | `,` | rename current window | | `p` | switch to previous window | | `n` | switch to next window | | `w` | list windows (and then select with arrow keys) | | | **Working with Panes** | | `%` | split window vertically | | `-` | split window horizontally | | → | go to right pane | | ← | go to left pane | | ↑ | go to upper pane | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Shortcuts | Key(s) | Description | | :-----: | ----------- | | `CTRL`+`b` `<command>` | sends `<command>` to tmux instead of sending it to the shell | | | **Working with Panes** | | % | split window vertically | | - | split window horizontally | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -78,3 +78,5 @@ Further Resources * [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058) * [tmux tutorial](http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/) * [Mouse support in OS X](http://www.davidverhasselt.com/enable-mouse-support-in-tmux-on-os-x/) * [(Video) Basic tmux Tutorial - Windows, Panes, and Sessions over SSH tutoriaLinux](https://www.youtube.com/watch?v=BHhA_ZKjyxo) -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 16 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -30,11 +30,23 @@ Scripting TMUX Starting multiple commands in multiple panes -------------------------------------------- Start a new tmux session with `tmux` before running the script! ``` sh #!/bin/bash SESSION=$USER tmux -2 new-session -d -s $SESSION tmux new-window -t $SESSION:1 -n "TMUX-Test" tmux split-window -h tmux select-pane -t 0 tmux send-keys "echo 'pane1'" C-m tmux select-pane -t 1 tmux send-keys "echo 'pane2'" C-m tmux split-window -v tmux send-keys "echo 'pane3'" C-m ``` -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,8 @@ Shortcuts | :-----: | ----------- | | `CTRL`+`b` | `send-prefix` this is like entering the control mode, you can now use the key(s) described below to do things | | | **Working with Panes** | | % | split window vertically | | - | split window horizontally | | → | go to right pane | | ← | go to left pane | | ↑ | go to upper pane | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Shortcuts ========= | Key(s) | Description | | :-----: | ----------- | | `CTRL`+`b` | `send-prefix` this is like entering the control mode, you can now use the key(s) described below to do things | | | **Working with Panes** | | → | go to right pane | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Shortcuts | Key(s) | Description | | ------- | ----------- | | `CTRL`+`b` | `send-prefix` this is like entering the control mode, you can now use the key(s) described below to do things | | | **Working with Panes** | | → | go to right pane | | ← | go to left pane | | ↑ | go to upper pane | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Shortcuts | Key(s) | Description | | ------- | ----------- | | `CTRL`+`b` | `send-prefix` this is like entering the control mode, you can now use the key(s) described below to do things | | Working with Panes | | → | go to right pane | | ← | go to left pane | | ↑ | go to upper pane | -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -38,6 +38,23 @@ tmux -2 attach-session -d Configuring TMUX ================ You can configure tmux via the `~/.tmux.conf` file. After making changes to the config file, you can update the configuration "on-the-fly" with tmux source ~/.tmux.conf Adding Mouse Support for Mac OS X --------------------------------- In order to have mouse support in Mac OS X, you can add the following lines to your config file: ``` sh set -g mode-mouse on set -g mouse-resize-pane on set -g mouse-select-pane on set -g mouse-select-window on ``` Further Resources ================= -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,10 @@ tmux Cheat Sheet **Table of Contents** * [Shortcuts](#shortcuts) * [Scripting TMUX](#scripting-tmux) * [Configuring TMUX](#configuring-tmux) * [Further Resources](#further-resources) Shortcuts -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 4 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,11 @@ tmux Cheat Sheet ================ **Table of Contents** [Shortcuts](#shortcuts)<br> [Scripting TMUX](#scripting-tmux)<br> [Configuring TMUX](#configuring-tmux)<br> [Further Resources](#further-resources) -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,11 @@ tmux Cheat Sheet *Table of Contents* [Shortcuts](#shortcuts) [Scripting TMUX](#scripting-tmux) [Configuring TMUX](#configuring-tmux) [Further Resources](#further-resources) -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,14 @@ tmux Cheat Sheet ================ *Table of Contents* [Shortcuts](#shortcuts) [Scripting TMUX](#scripting-tmux) [Configuring TMUX](#configuring-tmux) [Further Resources](#further-resources) Shortcuts ========= @@ -13,6 +21,9 @@ Shortcuts | ↓ | go to lower pane | Scripting TMUX ============== Starting multiple commands in multiple panes -------------------------------------------- @@ -24,9 +35,14 @@ tmux -2 attach-session -d ``` Configuring TMUX ================ Further Resources ================= * [tmuxinator](https://github.com/tmuxinator/tmuxinator) * [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058) * [tmux tutorial](http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/) * [Mouse support in OS X](http://www.davidverhasselt.com/enable-mouse-support-in-tmux-on-os-x/) -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,10 @@ Shortcuts | Key(s) | Description | | ------- | ----------- | | `CTRL`+`b` | `send-prefix` this is like entering the control mode, you can now use the key(s) described below to do things | | → | go to right pane | | ← | go to left pane | | ↑ | go to upper pane | | ↓ | go to lower pane | Starting multiple commands in multiple panes -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,9 @@ tmux Cheat Sheet Shortcuts ========= | Key(s) | Description | | ------- | ----------- | | `CTRL`+`b` | `send-prefix` this is like entering the control mode, you can now use the key(s) described below to do things | Starting multiple commands in multiple panes -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,14 @@ tmux Cheat Sheet ================ Shortcuts ========= Key(s) | Description -------------------- `CTRL`+`b` | `send-prefix` this is like entering the control mode, you can now use the key(s) described below to do things Starting multiple commands in multiple panes -------------------------------------------- -
michaellihs revised this gist
Sep 17, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,3 +17,4 @@ Further Resources * [tmuxinator](https://github.com/tmuxinator/tmuxinator) * [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058) * [tmux tutorial](http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/) -
michaellihs revised this gist
Sep 16, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,4 @@ Further Resources ================= * [tmuxinator](https://github.com/tmuxinator/tmuxinator) * [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058) -
michaellihs revised this gist
Sep 16, 2016 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,16 +4,16 @@ tmux Cheat Sheet Starting multiple commands in multiple panes -------------------------------------------- ``` sh tmux new-session -d 'command_1' tmux split-window -v 'command_2' tmux split-window -h 'command_3' tmux -2 attach-session -d ``` Further Resources ================= * [tmuxinator](https://github.com/tmuxinator/tmuxinator) * [tmux Cheat Sheet](https://gist.github.com/MohamedAlaa/2961058)
NewerOlder