根据环境变量更改tmux前缀密钥

时间:2014-01-30 21:06:45

标签: tmux

如果声明了环境变量,我想更改前缀。我在.tmux.conf

上尝试了以下配置

这总是改变(声明或不声明$ 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 个答案:

答案 0 :(得分: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