tmux 3.2에서 마우스를 이용한 copy&paste 관련 부분을 깔끔하게 설정할 수 있게 되었다.

 

tmux 소스를 빌드한 이후에 tmux 파일을 ~/bin 에 복사하였다. ( https://github.com/tmux/tmux/wiki/Installing#installing-tmux )

 

git clone https://github.com/tmux/tmux.git
cd tmux
git checkout 3.2
sh autogen.sh
./configure
make

 

tmux 3.2에서는 copy&paste를 위한 copy-command 'xsel -i' 이 지원되었는데,

이전 버전까지 사용하던 copy&paste 관련 지저분한 설정을 set -g copy-command 'xsel -i' 한 줄로 명료하게 정리할 수 있다.

 

다음과 같이 .tmux.conf를 업데이트한다.

# Use symbolic link for version control
# ln -s settings/.tmux.conf .tmux.conf

# restart :
#': source-file ~/.tmux.conf'

# References
# - https://gist.github.com/spicycode/1229612
# - https://blog.outsider.ne.kr/699#footnote_link_699_1
# - https://unix.stackexchange.com/questions/1045/getting-256-colors-to-work-in-tmux

# set -g default-terminal "screen-256color"
# it should be added in .bashrc
#if [ "$TERM" != "xterm-256color" ]; then
#  export TERM=xterm-256color
#fi


# Set scrollback history
set -g history-limit 50000

# Set mouse on : windows, panes, scroll, copy & paste
set -g mouse on

# Set clipboard
set -g copy-command 'xsel -i'

# Set rebinding the action key
set -g prefix C-j
unbind C-b
bind C-j send-prefix

# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left  select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up    select-pane -U
bind -n M-Down  select-pane -D
bind -n M-q     display-panes

# Use Alt-number keys to switch windows
bind -n M-0 select-window -t 0
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9

# Use Shift-arrow to switch windows
bind -n S-Left  previous-window
bind -n S-Right next-window

# Use | and - to split panes
bind | split-window -h
bind - split-window -v

#-------------------------------------------------------#
#Pane colours
#-------------------------------------------------------#
# set inactive/active window styles
set -g window-style 'fg=colour247,bg=colour236'
set -g window-active-style 'fg=colour250,bg=black'

#pane border
set -g pane-border-style bg=colour235
set -g pane-border-style fg=colour238
set -g pane-active-border-style bg=colour236
set -g pane-active-border-style fg=colour51
#-------------------------------------------------------#

# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green](#S) #(whoami)'
set -g status-left-length 20
#set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'

# Set highlight active window
setw -g window-status-current-style fg=black,bg=white

# tmux logging : over tmux 1.9
#run-shell ~/clone/path/logging.tmux

'Linux' 카테고리의 다른 글

tmux 사용법  (0) 2014.03.13
makefile의 phony  (0) 2013.05.07

+ Recent posts