tmuxの変数でのC-\バインディング

tmuxの変数でのC-\バインディング

では、.tmux.conf次のことが期待どおりに動作します。

bind -n C-\ display-message 'hello'

変数(たとえば)に定義されているキーをバインドしようとしていますkey。私は次の2つの試みをしました。

a=C-\
bind -n $a display-message 'hello'
# Produces: unknown command: -n

a=C-\\
bind -n $a display-message 'hello'
# Produces: unknown key: C-\\

私が望むことを達成する方法はありますか?

ベストアンサー1

最初のケースでは、\改行が続くか、何かをする前に改行が必要だと思います。

これは働きます:

a='C-\'
bind -n $a display-message 'hello'

おすすめ記事