Skip to content

Instantly share code, notes, and snippets.

@gadzhimari
Created September 25, 2018 13:34
Show Gist options
  • Save gadzhimari/93f594daf5caa9d76753cae89c4cd7c1 to your computer and use it in GitHub Desktop.
Save gadzhimari/93f594daf5caa9d76753cae89c4cd7c1 to your computer and use it in GitHub Desktop.

Install tmux

brew install tmux

Run tmux -CC or tmux -CC attach in iTerm2 and then menu is shown on terminal:

  • ESC to detach
  • C to run commands
  • X to force quit
  • L for log

Control sessions

  • new -s session-name [-c working-dir] [shell-cmd] alias for new-session
  • kill-session -t target-session
  • rename [-t target-session] new-name alias for rename-session
  • ls alias for list-sessions
  • attach -t target-session [-c working-dir] alias for attach-session

target-session

  • ID: $1
  • name: myse or =mysession (exact match)

Clients

  • lsc alias for list-clients

Windows

  • neww [-c working-dir] [-t target-window] -n window-name [shell-cmd] alias for new-window
  • killw -t target-window alias for kill-window
  • renamew -t target-window new-name alias for rename-window
  • lsw -t target-session alias for list-windows

target-window

  • specified in form: session:window, eg. mysession:1
  • ID: @1
  • name: mysession:mywindow / mysession:mywin / mysession:=mywindow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment