I've attached a proposed patch to the man page, that updates the
details described in this thread.

Thanks.
-FR.

On Thu, Nov 3, 2011 at 5:19 PM, Nicholas Marriott
<nicholas.marri...@gmail.com> wrote:
> On Thu, Nov 03, 2011 at 02:57:40PM -0700, Felix Rosencrantz wrote:
>> I was having a problem where my window names were disappearing when my shell
>> started, at first I was thinking the problem was related to the
>> automatic-renaming option.  After some investigation, the problem was that my
>> prompt was sending a code "\033k\033\\", which is used to clear screen's 
>> title,
>> there is a note about this in the comments in input.c.
>>
>> One problem that made this difficult to track down was that the manual page 
>> is
>> not very precise, and particular details are omitted.  It's not clear to me 
>> from
>> the man page that windows and panes have their own separate title/names.
>> Though here is what I think the state of tmux is:
>>    Windows have names which can be set in one of three ways:
>>    1) By tmux command (e.g. new-window, new-session, or rename-window)
>>    2) By escape code (e.g. printf '\033kWINDOW_NAME\033\\")
>>    3) Automatic renaming, which tries to be the active command in the
>>       active pane of the window.
>
> yes this is correct
>
> personally i don't like that escape sequence, it is a gnu screen
> extension, should try to find something more sensible instead. maybe
> \033]1, not sure what xterm uses that for
>
> i'm not sure if we should document specific escape sequences, although
> if you're adding a section on naming and titles it'd make sense to cover
> these i suppose
>
>>    4) Man page issues:
>>       1) doesn't mention escape code, and that escape code turns off
>> automatic rename
>>       2) automatic-renaming isn't specific about which pane is used.
>>       3) The status-left option mentions both a window title&name. Here 
>> window
>>          title, is actually the active pane title.
>>    Panes have titles, which can be set one way:
>>    1) By escape code: printf '\033]2;My Title\033\\'
>
> yes that's right
>
> title is what would typically be displayed in the xterm window title in
> a window manager
>
>>    2) Man page issues:
>>       1) says escape code is used for "window title"
>>       2) The FORMATS section lists "pane_title", but otherwise not
>> mentioned in man page.
>>    3) FAQ incorrectly states: * tmux panes do not have individual
>> names, titles and so on.
>>    Clients have a title, used to set xterm titles,
>>    1) Can only be specified by tmux command set-titles-string
>>    2) Documentation issues:
>>       1) The man page isn't very clear set-titles-string applies to clients
>>
>>
>> I may still be confused, so would like to confirm if this correct.  It seems
>> like it would be useful if details about names&title were more precisely
>> spelled out in a separate man page section.
>>
>> -FR.
>>
>> ------------------------------------------------------------------------------
>> RSA(R) Conference 2012
>> Save $700 by Nov 18
>> Register now
>> http://p.sf.net/sfu/rsa-sfdev2dev1
>> _______________________________________________
>> tmux-users mailing list
>> tmux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tmux-users
--- tmux.1.orig	2011-12-09 09:06:40.568409143 -0800
+++ tmux.1	2011-12-09 08:56:42.828410291 -0800
@@ -2110,7 +2114,7 @@
 .It Li "#I" Ta "Current window index"
 .It Li "#P" Ta "Current pane index"
 .It Li "#S" Ta "Session name"
-.It Li "#T" Ta "Current window title"
+.It Li "#T" Ta "Current pane title"
 .It Li "#W" Ta "Current window name"
 .It Li "##" Ta "A literal" Ql #
 .El
@@ -2129,13 +2133,9 @@
 .Sx ENVIRONMENT
 section).
 .Pp
-The window title (#T) is the title set by the program running within the window
-using the OSC title setting sequence, for example:
-.Bd -literal -offset indent
-$ printf '\e033]2;My Title\e033\e\e'
-.Ed
-.Pp
-When a window is first created, its title is the hostname.
+For details on how the names and titles can be set see the 
+.Sx "NAMES AND TITLES"
+section.
 .Pp
 #[attributes] allows a comma-separated list of attributes to be specified,
 these may be
@@ -2654,6 +2654,57 @@
 .It Li "window_name" Ta "Name of window"
 .It Li "window_width" Ta "Width of window"
 .El
+.Sh NAMES AND TITLES
+.Nm
+allows sessions, clients, windows and panes to have a name or a
+title.
+A name is used for specifying targets in commands and
+for display.
+A title is used only as output of list commands or status lines.
+The following rules describe how titles and names are
+created and modified.
+.Pp
+A session has a name which can be set by the commands
+.Ic new-session
+and
+.Ic rename-session .
+.Pp
+A client has a title, which can be set by the
+.Ic set-titles-string
+option.  A client title is only displayed as the the xterm title of the 
+terminal holding a client.  In commands,
+.Ar target-client
+is the name of
+the
+.Xr pty 4
+file to which the client is connected.
+.Pp
+A window has a name, which can be set in one of three ways:
+.Bl -enum -width Ds
+.It
+Command (e.g. 
+.Ic new-window ,
+.Ic new-session
+or
+.Ic rename-window )
+.It
+Escape code, for example:
+.Bd -literal -offset indent
+$ printf '\e033kWINDOW_NAME\e033\e\e"
+.Ed
+.It
+Automatic renaming, which sets the name to the active command in the window's
+active pane.  See the
+.Ic automatic-rename
+option for details.
+.El
+.Pp
+A window title is the pane title of the active pane.
+.Pp
+A pane has a title. When a pane is first created, its title is the hostname. A pane's title can be set via the OSC title setting sequence, for example:
+.Bd -literal -offset indent
+$ printf '\e033]2;My Title\e033\e\e'
+.Ed
 .Sh ENVIRONMENT
 When the server is started,
 .Nm
@@ -2717,8 +2768,8 @@
 By default, the status line is enabled (it may be disabled with the
 .Ic status
 session option) and contains, from left-to-right: the name of the current
-session in square brackets; the window list; the current window title in double
-quotes; and the time and date.
+session in square brackets; the window list; the title of the active pane
+in double quotes; and the time and date.
 .Pp
 The status line is made of three parts: configurable left and right sections
 (which may contain dynamic content such as the time or output from a shell
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to