2014-01-30 55 views
2

如果声明了环境变量,我想更改前缀。我试过在.tmux.conf根据环境变量更改tmux前缀密钥

的follwing配置本随时更改(以$ SSH_CLIENT宣战与否):

if-shell "test -n $SSH_CLIENT" "set -g prefix C-a" 

也:

if-shell "[[ -n $SSH_CLIENT ]]" "set -g prefix C-a" 

但是这个代码永远不会改变:

if-shell "[ -n $SSH_CLIENT ]" "set -g prefix C-a" 
+1

第一和第三应该是相同的,如'['为'test'的同义词。 – chepner

回答

3

最后,它在tmux-users邮件列表的帮助下工作,但仍然存在问题ħ1.8

# if if-shell goes in the beggining it will break the following command. this is going to be fixed after 1.8 
# make c-a work as c-b 
if-shell 'test -z "$SSH_CLIENT"' 'set -g prefix C-a' 

http://sourceforge.net/mailarchive/forum.php?thread_name=20140201002909.GG11126%40yelena.nicm.ath.cx&forum_name=tmux-users

https://github.com/brauliobo/gitconfig/blob/master/configs/.tmux.conf