Skip to content

Instantly share code, notes, and snippets.

@jmoody
Last active February 25, 2024 00:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmoody/ccd1d44085f829cc44e9 to your computer and use it in GitHub Desktop.
Save jmoody/ccd1d44085f829cc44e9 to your computer and use it in GitHub Desktop.
tmate on macOS

Tmate is a remote tmux session over ssh.

Intall with Homebrew

$ brew update && brew upgrade
$ brew install tmux
$ brew install reattach-to-user-namespace
$ brew install tmate

.tmux.conf

Install the following to ~/.tmux.conf

# **** replace 'bash' with the shell that you use ****
set-option -g default-command "reattach-to-user-namespace -l bash"

set-window-option -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U

set-option -g default-terminal "screen-256color"

set -g history-limit 500000
set-option -g renumber-windows on

bind-key C-b last-window

# Start tab numbering at 1
set -g base-index 1

set -s escape-time 0

bind | split-window -h
bind - split-window -v

Start a tmate session

$ tmate
$ tmate show-message
Thu Feb 15 11:55:57 2018 [tmate] Connecting to ssh.tmate.io...
Thu Feb 15 11:55:57 2018 [tmate] Note: clear your terminal before sharing readonly access
Thu Feb 15 11:55:57 2018 [tmate] web session read only: https://tmate.io/<url>
Thu Feb 15 11:55:57 2018 [tmate] ssh session read only: ssh <key>@fk2.tmate.io
Thu Feb 15 11:55:57 2018 [tmate] web session: https://tmate.io/t/<key>
Thu Feb 15 11:55:57 2018 [tmate] ssh session: ssh <user>@fk2.tmate.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment