質問

I want to change the prefix if a environment variable is declared. I've tried the follwing configurations on .tmux.conf

This always change (with $SSH_CLIENT declared or not):

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

and also:

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

But this code never change:

if-shell "[ -n $SSH_CLIENT ]" "set -g prefix C-a"
役に立ちましたか?

解決

Finally, it worked, with the help from tmux-users mailing list, but there is still a problem with 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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top