Skip to content

Instantly share code, notes, and snippets.

@jmoody jmoody/
Last active Feb 18, 2020

What would you like to do?
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


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
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:<url>
Thu Feb 15 11:55:57 2018 [tmate] ssh session read only: ssh <key>
Thu Feb 15 11:55:57 2018 [tmate] web session:<key>
Thu Feb 15 11:55:57 2018 [tmate] ssh session: ssh <user>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.