Skip to content

Instantly share code, notes, and snippets.

@jmoody jmoody/tmate-on-macOS.md
Last active Feb 18, 2020

Embed
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

.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
You can’t perform that action at this time.