본문 바로가기
C.W.K.
Stream
Lesson 02 of 03 · published

Status 바와 Plugin 매니저 (TPM)

~14 min · tmux, status-bar, tpm, plugins

Level 0갇힌 자
0 XP0/35 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

status 줄은 대시보드야

tmux 화면 맨 아래 줄이 손볼 수 있는 status 줄이야. 세션 이름, window 목록, 시각, 시스템 정보까지 — 계산해서 뽑을 수 있는 건 뭐든 띄울 수 있어. 기본값도 제 역할은 하지만, 설정 몇 줄이면 훨씬 유용하고 보기도 좋아져.

status 줄을 이루는 조각들

  • status-position — 위냐 아래냐.
  • status-style — 줄 배경색과 기본 글자색.
  • status-left / status-right — 좌우 끝에 그려질 문자열.
  • window-status-format / window-status-current-format — window 탭 하나하나의 모양.
  • pane-border-style / pane-active-border-style — pane 사이 경계선 색.

이 문자열 안에서 #{var}로 변수를 끼워 넣고 #(cmd)로 셸 명령을 돌릴 수 있어. 자주 쓰는 건 #S (세션 이름), #I (window 번호), #W (window 이름), #H (호스트), #(date +%H:%M) (시계) 야.

TPM — Tmux Plugin Manager

TPM이 tmux의 사실상 표준 plugin 매니저야. 한 번 깔고, ~/.tmux.conf에 쓸 plugin을 적고, prefix + I로 설치하고, prefix + U로 갱신해. 생태계 자체는 작은 편인데, 그 안에 있는 건 다들 진짜 문제를 하나씩 풀어줘.

바로 깔 만한 네 개

  • tmux-plugins/tpm — 매니저 본체. 이건 필수야.
  • tmux-plugins/tmux-sensible — 다들 동의하는 기본값 몇 개를 잡아줘 (history-limit, escape-time, focus-events). 앞에서 직접 설정한 것과 겹치긴 하는데 해롭지 않고, 다른 config들이 이게 깔려 있다고 가정하는 경우가 많아.
  • tmux-plugins/tmux-resurrect — 재부팅 너머로 tmux 세션을 저장하고 복원해. prefix + Ctrl-s로 저장하고 prefix + Ctrl-r로 되살려. 복원된 세션은 window와 pane, 작업 디렉토리, 그리고 원하면 돌고 있던 프로그램까지 갖고 와.
  • tmux-plugins/tmux-continuum — 15분마다 알아서 저장해줘 (tmux-resurrect를 써서). continuum-restore on을 켜두면 tmux가 시작할 때 마지막 세션을 알아서 되살려.
Resurrect + Continuum = 재부팅 너머의 영속성. 이게 없으면 재부팅 한 번에 tmux 상태가 날아가. 둘을 같이 쓰면 작업 공간이 재부팅도, OS 업그레이드도, (홈 디렉토리를 옮긴다면) 새 머신으로 이사하는 것까지 살아남아. 사람들이 tmux를 두고 "영원하다"고 할 때 가리키는 게 바로 이 조합이야.

클립보드 연동

기본 상태에서는 tmux의 복사가 tmux 안쪽 buffer에만 들어가. 다른 앱에서도 붙여넣으려면 시스템 클립보드로 흘려보내야 해. copy-mode의 y 키를 pbcopy (macOS), xclip (Linux X11), wl-copy (Wayland) 로 파이프하게 걸어두면 돼. tmux-yank plugin은 이걸 플랫폼 가리지 않고 알아서 해주고.

Code

Status 바 스타일링 — 깔끔한 다크 스킴·tmux
# 위치
set -g status-position bottom

# 컬러 (GitHub Dark 풍)
set -g status-style "bg=#161b22,fg=#8b949e"
set -g status-left "#[fg=#019833,bold] #S "
set -g status-right "#[fg=#8b949e] %Y-%m-%d %H:%M "
set -g status-left-length 40
set -g status-right-length 40

# Window 탭
setw -g window-status-format " #I:#W "
setw -g window-status-current-format "#[fg=#e6edf3,bg=#30363d,bold] #I:#W "

# Pane 보더
set -g pane-border-style "fg=#30363d"
set -g pane-active-border-style "fg=#019833"

# 활동 하이라이트
setw -g monitor-activity on
set -g visual-activity off
TPM install·bash
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Plugin 블록 — ~/.tmux.conf 끝에 붙여·tmux
# ───────────── Plugin ─────────────
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'

# Resurrect 트윅
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'

# Continuum 트윅
set -g @continuum-restore 'on'
set -g @continuum-save-interval '15'

# 이 줄이 마지막이어야 함
run '~/.tmux/plugins/tpm/tpm'
TPM 키 바인딩·text
prefix + I        .tmux.conf 에 리스트된 plugin install
prefix + U        설치된 plugin update
prefix + alt + u  .tmux.conf 에 없는 plugin uninstall
플랫폼별 클립보드 yank (tmux-yank 쓰면 skip)·tmux
# macOS
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"

# Linux X11
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -sel clip -i"

# Linux Wayland
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"

External links

Exercise

TPM을 깔아 (위 git clone). plugin 블록을 ~/.tmux.conf에 넣고 prefix + r로 다시 읽힌 다음 prefix + I로 설치해. 확인할 것들이야. (1) prefix + Ctrl-s가 저장 메시지를 띄우는지, (2) 머신을 재부팅하거나 tmux kill-server를 한 다음 tmux를 다시 켰을 때 continuum이 이전 세션을 되살려주는지, (3) copy mode에서 텍스트를 복사해 다른 앱에 붙여넣어 클립보드 연동이 되는지.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.