tmuxと制御シーケンス文字の問題

tmuxと制御シーケンス文字の問題

MacOSXのコマンドラインでターミナルウィンドウのサイズを変更しようとしています。

次のコマンドを使用して、端末の幅と高さを調整できます(Control Sequence Introducer CSI)

printf '\e[8;100;200t' "resize to 200x100

ただし、端末でtmuxを使用すると、コマンド(printf '\ e [8; 100; 200t))は機能しなくなります。

どんなアドバイスも本当にありがとうございます。

これは私のtmux設定ファイルです。

bind r source-file ~/.tmux.conf \; display "Reloaded!"  #Reload with ctrl-r
set-window-option -g mode-keys vi                       #copy-mode vim-like 
set -g prefix `                                         #prefix from ctrl-b to ctrl-a
unbind C-b                                              #allow ctrl-b for other things
set -sg escape-time 1                                   #quicker responses
bind ` send-prefix                                      #Pass on ctrl-a for other apps
set -g base-index 1                                     #Numbering of windows
setw -g pane-base-index 1                               #Numbering of Panes
bind \ split-window -v                                  #Split panes horizontal
bind v split-window -h                                  #Split panes vertically

unbind-key j
bind-key j select-pane -D # Similar to 'C-w j' to navigate windows in Vim
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R

unbind-key Left 
bind-key  Left resize-pane -L 10 
unbind-key Right 
bind-key  Right resize-pane -R 10 
unbind-key Up 
bind-key  Up resize-pane -U 10 

unbind-key Down 
bind-key  Down resize-pane -D 10 

set -g window-status-current-style fg=red
set -g default-command "reattach-to-user-namespace -l /bin/bash"

ベストアンサー1

エスケープシーケンスはtmuxによって解釈され、tmuxが実行されているターミナルプログラムに渡されません。これを通過させるには、エスケープシーケンスをラップしてtmuxにそれを渡すように指示する必要があります。

printf '\ePtmux;\e%s\e\\' "${escape_sequence}"

ここで変数は、$escape_sequencetmux が端末に渡したいシーケンスです。たとえば、元の問題のシーケンスは次のとおりです。

printf '\ePtmux;\e\e[8;100;200t\e\\'

これに関するドキュメントはあまりありませんが、バージョン1.5のCHANGESファイルで証拠を見つけることができます。https://github.com/tmux/tmux/blob/1.5/CHANGES#L33

おすすめ記事