0

I'm setting up a window template script in the tmux.conf file and want to have a statement that add a pane title. In a related post 2019 the solution is partially provided by adding a pane title from the command line - link. A solution is quoted below:-

 tmux select-pane -t {pane} -T {title}

    Examples:
    tmux select-pane -T title1          # Change title of current pane
    tmux select-pane -t 1 -T title2     # Change title of pane 1 in current window
    tmux select-pane -t 2.1 -T title3   # Change title of pane 1 in window 2`

How do I translate this into a line in the .tmux.conf file?

I've tried the following;

send-keys 'tmux select-pane -t 1 -T titles' C-m ;
select-pane -t 1 -T titles C-m ;
select-pane -t 1-T titles

Leighton
  • 11
  • 2
  • you've tried so what's the result? what problems do you hit? – pynexj Feb 02 '23 at 09:47
  • I'm now very confused. sounds like you are talking about another problem? – pynexj Feb 03 '23 at 00:32
  • please clarify and update your question. – pynexj Feb 04 '23 at 00:21
  • I'm running Tmux on a DO droplet. This question started out as a problem with the pane title arguments not seeming to work when inserted into the .tmux.conf file. Various argument arrangements, as above, were tried with no effect; sorcing of the conf file was done between changes. I then suspecting that no changes made to the conf file were been reflected in the window. This was confirmed by making wholesale changes to the conf without result. – Leighton Feb 04 '23 at 12:47
  • The server was killed and restarted. Changes to the conf file still had no effect on the window layout. However on restarting the session was restored automatically - i use plugins; tmux-continuum & tmux-resurrect. I deleted these two plugins and restarted the session. Changes to the conf file were now being reflected in the window layout. Deleting these two plugins seems to be a bit of a work-around but it provided a solution. – Leighton Feb 04 '23 at 12:48

1 Answers1

0

Finally - although changes to the config file seem to be effected by the continuum & reurrect plugins I found that in order for this to work:-

    select-pane -T title1          # Change title of current pane
    select-pane -t 1 -T title2     # Change title of pane 1 in current window
    select-pane -t 2.1 -T title3   # Change title of pane 1 in window 2

You had to first add the following to the conf file:-

    set -g pane-border-format "#{pane_index} #{pane_current_command}"
Leighton
  • 11
  • 2