尝试在OS X Mavericks上运行tmux。
这是我的~/.tmux.conf
# Keybindings
unbind c
unbind C-b
unbind C-a
unbind %
unbind ,
unbind .
unbind n
unbind p
unbind '"'
unbind l
unbind &
unbind "'"
# set-option -g prefix C-a # C-a for perfix just like screen
set -g prefix `
bind-key ` send-prefix
bind-key n new-window
bind-key C-a last-window
bind-key | split-window -h
bind-key \ split-window -h
bind-key - split-window -v
bind-key x kill-pane
bind-key X kill-window
# bind-key q confirm-before kill-session
bind-key q confirm-before kill-server
bind-key , previous-window # <
bind-key . next-window # >
bind-key < swap-window -t :-
bind-key > swap-window -t :+
# bind-key Escape copy-mode -u
# bind-key Up copy-mode -u
bind-key r source-file ~/.tmux.conf\; display-message " ✱ ~/.tmux.conf was reloaded"
bind-key R refresh-client
# bind-key a send-key C-a
# set status bar
set-option -g status-utf8 on
set-option -g status-bg colour232
set-option -g status-fg colour235
# set-option -g status-left '⣿'
# set-option -g status-right '⡇ #[bold]❐ #S:#I#[default] ⡇ #[bold]#(whoami) ● #H#[default] '
# set-option -g status-right '⡇ ❐ #S ⡇ ❖ #(rvm tools identifier) ⡇ #(whoami) ● #H '
set-option -g status-left '⣿'
set-option -g status-right '#(whoami) ● #H#[default] '
set-option -g status-right-length 60
set-option -g status-left-length 60
# highlight active window
set-window-option -g window-status-current-bg colour10
set-window-option -g window-status-current-fg colour234
执行tmux时出现以下错误:
/Users/levelone/.tmux.conf:2: unknown key: c [0/0]
/Users/levelone/.tmux.conf:3: unknown key: C-b
/Users/levelone/.tmux.conf:4: unknown key: C-a
/Users/levelone/.tmux.conf:5: unknown key: %
/Users/levelone/.tmux.conf:6: unknown key: ,
/Users/levelone/.tmux.conf:7: unknown key: .
/Users/levelone/.tmux.conf:8: unknown key: n
/Users/levelone/.tmux.conf:9: unknown key: p
/Users/levelone/.tmux.conf:10: unknown key: "
/Users/levelone/.tmux.conf:11: unknown key: l
/Users/levelone/.tmux.conf:12: unknown key: &
/Users/levelone/.tmux.conf:13: unknown key: '
/Users/levelone/.tmux.conf:16: bad key: `
/Users/levelone/.tmux.conf:17: unknown command: send-prefix
/Users/levelone/.tmux.conf:19: unknown command: new-window
/Users/levelone/.tmux.conf:20: unknown command: last-window
/Users/levelone/.tmux.conf:21: usage: split-window [-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] [-t target-pane] [command]
/Users/levelone/.tmux.conf:22: usage: split-window [-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] [-t target-pane] [command]
/Users/levelone/.tmux.conf:23: usage: split-window [-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] [-t target-pane] [command]
/Users/levelone/.tmux.conf:24: unknown command: kill-pane
/Users/levelone/.tmux.conf:25: unknown command: kill-window
/Users/levelone/.tmux.conf:35: unknown command: refresh-client
/Users/levelone/.tmux.conf:39: bad value: on
/Users/levelone/.tmux.conf:40: bad colour: colour232
/Users/levelone/.tmux.conf:41: bad colour: colour235
/Users/levelone/.tmux.conf:49: value is invalid: 60
/Users/levelone/.tmux.conf:50: value is invalid: 60
/Users/levelone/.tmux.conf:53: bad colour: colour10
/Users/levelone/.tmux.conf:54: bad colour: colour234
/Users/levelone/.tmux.conf:56: bad attributes: dim
/Users/levelone/.tmux.conf:60: bad value: off
/Users/levelone/.tmux.conf:61: bad value: on
/Users/levelone/.tmux.conf:62: bad value: on
/Users/levelone/.tmux.conf:65: bad value: on
/Users/levelone/.tmux.conf:67: bad value: off
/Users/levelone/.tmux.conf:69: bad attributes: normal
/Users/levelone/.tmux.conf:75: bad value: on
/Users/levelone/.tmux.conf:76: unknown value: vi
/Users/levelone/.tmux.conf:77: unknown value: on
/Users/levelone/.tmux.conf:84: bad colour: yellow
/Users/levelone/.tmux.conf:85: bad colour: white
/Users/levelone/.tmux.conf:88: value is invalid: 2000
/Users/levelone/.tmux.conf:92: unknown value: vi
/Users/levelone/.tmux.conf:93: usage: select-pane [-lDLRU] [-t target-pane]
/Users/levelone/.tmux.conf:94: usage: select-pane [-lDLRU] [-t target-pane]
/Users/levelone/.tmux.conf:95: usage: select-pane [-lDLRU] [-t target-pane]
/Users/levelone/.tmux.conf:96: usage: select-pane [-lDLRU] [-t target-pane]
/Users/levelone/.tmux.conf:102: unknown command: copy-mode
/Users/levelone/.tmux.conf:103: unknown command: paste-buffer
/Users/levelone/.tmux.conf:107: unknown command: begin-selection
/Users/levelone/.tmux.conf:119: value is invalid: 1
答案 0 :(得分:4)
我怀疑你的文件有CR + LF行结尾; tmux 期望正常的Unix风格的LF专线结尾。
perl -pi -e 's/\r$//' ~/.tmux.conf
答案 1 :(得分:0)
您也可以使用dosu2unix
(通过MacPorts提供)