讓 tmux 根據會話名稱設定 urxvt 視窗標題

讓 tmux 根據會話名稱設定 urxvt 視窗標題

我每天都會推出一堆urxvtc -e tmux.

我正在嘗試找到一種方法來使用透過設定的當前 tmux 會話名稱來覆寫 urxvt X 視窗標題(“tmux”):rename-session session_name

你們有人實現了嗎?

謝謝 !

答案1

嘗試將以下內容新增至 ~/.tmux.conf 檔案中。

# Turn on window titles
set -g set-titles on

# Set window title string
#  #H  Hostname of local host
#  #I  Current window index
#  #P  Current pane index
#  #S  Session name
#  #T  Current window title
#  #W  Current window name
#  #   A literal ‘#’
set -g set-titles-string '#S:#I.#P #W'

# Automatically set window title
setw -g automatic-rename

相關內容