Tmux Plugins (202605)

Tmux 시리즈:

  1. Tmux Start (202605)
  2. Tmux Cheatsheet (202605)
  3. Tmux Plugins (202605)

수정

2026-06-07: resurrect 무한 루프 내용 추가

Plugin manager

Tmux Pluin Manager 를 설치하고, tmux 기능을 확장할 수 있다.

tpm 설치

먼저 사용자 홈 디렉토리에 저장한다.

1
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

다음 설정을 tmux.conf 에 저장한다.

1
2
3
4
5
6
7
8
9
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

# other plugins ...

# Initialize TMUX plugin manager
# (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

그리고 tmux 환경설정을 다시 탑재한다.

1
tmux source ~/.tmux.conf

plugin 설치와 키 바인딩

새 플러그인을 .tmux.confset -g @plugin 로 입력한다.

  1. 플러그인 설치를 위해서 C-I (대문자) 를 실행
  2. 플러그인 업그레이드를 위해서 C-U (대문자) 를 실행
  3. 플러그인 삭제:
    • .tmux.conf 에서 플러그인 삭제
    • C-M-u (소문자)

tpm 으로 해당 플러그인은 ~/.tmux/plugins/ 디렉토리에 패치된다.


주요 plugins

https://github.com/tmux-plugins/list

몇가지 플러그인을 설치해서 사용해 보자

tmux-sidebar

tmux 화면에 sidebar 로 tree 형식의 디렉토리 구조를 보여준다.

  1. .tmux.conf 에 플러그인을 추가한다.
1
set -g @plugin 'tmux-plugins/tmux-sidebar'
  1. tmux sourceC-r 로 설정을 재 탑재한다.

  2. C-I 로 플러그인 설치를 시작한다.

1
2
3
4
5
6
7
8
9
Already installed "tpm"
Installing "tmux-sensible"
"tmux-sensible" download success
Installing "tmux-sidebar"
"tmux-sidebar" download success

TMUX environment reloaded.

Done, press ESCAPE to continue.
  1. side-bar 키 바인딩
  • prefix + Tab - toggle sidebar with a directory tree
  • prefix + Backspace - toggle sidebar and move cursor to it (focus it)

plugin 삭제

  1. .tmux.conf 에서 해당 플러그인을 삭제한다.
  2. C-M-u 로 플러그인을 삭제한다.

여기서는 tmux-cpu 를 삭제하고 있다.

1
2
3
4
5
6
Removing "tmux-cpu"
"tmux-cpu" clean success

TMUX environment reloaded.

Done, press ESCAPE to continue.

Tmux-Resurrection

_tmux-resurrect_는 tmux 세션을 백업/복구 할 수 있는 플러그인이다. tmux.conf에 다음을 추가

1
set -g @plugin 'tmux-plugins/tmux-resurrect'

플러그인 설치를 위해서 C-I 를 실행하면 설치를 시작한다.

Resurrection 플러그인으로 백업/복구하는 키는 다음 같이 지정되어 있다:

  • C-s : save
  • C-r : restore

Tmux-continuum

tmux-continuum은 tmux-resurrect 플러그인과 연동하여 tmux 세션 상태를 주기적으로 자동 저장하고, 시스템 부팅 시 복원해주는 플러그인입니다.

tmux-continuum 의 주요 기능은:

  • tmux 환경을 15분 마다 자동 저장
  • 컴퓨터/서버 시작시 tmux 자동 시작 가능
  • tmux 시작시 자동 복구 가능
  • tmux 1.9 이상, bash, tmux-resurrect plugin

설치

  1. 설치는 .tmux.conf 파일에 mux-resurrecttmux-continuum 플러그인을 추가:
1
2
3
4
5
6
7
8
9
10
11
12
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

# (continuum) tmux 시작 시 마지막 세션 자동 복원
set -g @continuum-restore 'on'

# (continuum) 자동 저장 간격 변경 (기본값: 15분)
set -g @continuum-save-interval '15'

# (continuum) continuum 상태표시
set -g status-right 'Continuum status: #{continuum_status}'
  1. tmux sourceC-r 로 설정을 재 탑재한다.

  2. C-I 로 플러그인 설치를 시작한다.

1
2
3
4
5
6
7
8
9
10
11
Already installed "tpm"
Already installed "tmux-sensible"
Already installed "tmux-sidebar"
Installing "tmux-resurrect"
"tmux-resurrect" download success
Installing "tmux-continuum"
"tmux-continuum" download success

TMUX environment reloaded.

Done, press ESCAPE to continue

이제부터 15분 마다 자동 저장하고 서버를 재시작한 후에 tmux를 다시 시작하면 저장한 환경을 자동으로 복구해 준다.

  1. 키 바인딩
  • 세션 수동 저장: Ctrl + b 누른 후 Ctrl + s (Resurrect 기능)
  • 세션 수동 복원: Ctrl + b 누른 후 Ctrl + r (Resurrect 기능)

tmux 세션을 모두 나와서 tmux 서버를 모두 kill-session 같은 명령으로 종료시킨후 tmux를 다시 시작하면 .tmux/resurrect 에 저장된 마지막 세션이 복구되는 것을 확인할 수 있다.


tmux 무한 exited 문제

tmux-resurrectcontinuum은 가끔 문제를 일으킨다.

재시작 등의 이유로 이전 저장한 세션을 탑재중 무한 exited 로 종료되는 상황이 그것이다.

예를 들어 tmux2k 설정중 시스템 locale 을 다시 설정하게 된 후 tmux 가 exited 되는 문제가 발생했다.

세션을 모두 빠져나간다

1
$ tmux kill-server # 다른 터미널에서 실행

방법1:

.tmux.conf 에서 set -g @continuum-restore ‘on’을 #으로 주석 처리

tmux 실행 후 정상 작동 확인후 안되면 방법2로 모든 세션을 초기화 한다.

방법2. continuum 세션 삭제

continuum 의 세션은 백업 파일이 꼬여서 그런것 같다.

tmux-resurrectcontinuum은 세션 정보를 특정 디렉토리에 텍스트 파일로 저장하고 있다.

기본 저장 위치는 아래와 같다.

1
2
3
4
5
$ ls -l .local/share/tmux/resurrect/
total 4
lrwxrwxrwx 1 user user 34 5월 29 21:47 last -> tmux_resurrect_20260529T214713.txt
-rw-r--r-- 1 user user 239 5월 29 21:36 tmux_resurrect_20260529T213616.txt
-rw-rw-r-- 1 user user 0 5월 29 21:47 tmux_resurrect_20260529T214713.txt

기존에 저장된 백업 데이터를 삭제(초기화)한다.

1
rm -rf ~/.local/share/tmux/resurrect/*.txt

해당 세션 정보 백업 파일을 삭제후 tmux 를 시작하면 깨끗하게 다시 시작된다.


CLI 로 플러그인 관리

https://github.com/tmux-plugins/tpm/blob/master/docs/managing_plugins_via_cmd_line.md

Author

Gangtai Goh

Posted on

2026-05-26

Updated on

2026-06-07

Licensed under