Update of /cvsroot/tmux/tmux
In directory vz-cvs-2.sog:/tmp/cvs-serv30295
Modified Files:
options-table.c tmux.1 tmux.h tty-term.c tty.c
Log Message:
Sync OpenBSD patchset 904:
Use the tsl and fsl terminfo(5) capabilities to update terminal title
and automatically fill them in on terminals with the XT capability
(which means their title setting is xterm-compatible). From hsim at
gmx.li.
Index: tty.c
===================================================================
RCS file: /cvsroot/tmux/tmux/tty.c,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -d -r1.208 -r1.209
--- tty.c 9 Apr 2011 07:48:58 -0000 1.208
+++ tty.c 18 May 2011 20:28:43 -0000 1.209
@@ -369,14 +369,13 @@
void
tty_set_title(struct tty *tty, const char *title)
{
- if (strstr(tty->termname, "xterm") == NULL &&
- strstr(tty->termname, "rxvt") == NULL &&
- strcmp(tty->termname, "screen") != 0)
+ if (!tty_term_has(tty->term, TTYC_TSL) ||
+ !tty_term_has(tty->term, TTYC_FSL))
return;
- tty_puts(tty, "\033]0;");
+ tty_putcode(tty, TTYC_TSL);
tty_puts(tty, title);
- tty_putc(tty, '\007');
+ tty_putcode(tty, TTYC_FSL);
}
void
Index: options-table.c
===================================================================
RCS file: /cvsroot/tmux/tmux/options-table.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- options-table.c 18 Apr 2011 21:07:58 -0000 1.7
+++ options-table.c 18 May 2011 20:28:40 -0000 1.8
@@ -354,7 +354,7 @@
{ .name = "terminal-overrides",
.type = OPTIONS_TABLE_STRING,
- .default_str = "*88col*:colors=88,*256col*:colors=256"
+ .default_str = "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
},
{ .name = "update-environment",
Index: tty-term.c
===================================================================
RCS file: /cvsroot/tmux/tmux/tty-term.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- tty-term.c 9 Apr 2011 07:48:58 -0000 1.47
+++ tty-term.c 18 May 2011 20:28:43 -0000 1.48
@@ -63,6 +63,7 @@
{ TTYC_EL, TTYCODE_STRING, "el" },
{ TTYC_EL1, TTYCODE_STRING, "el1" },
{ TTYC_ENACS, TTYCODE_STRING, "enacs" },
+ { TTYC_FSL, TTYCODE_STRING, "fsl" },
{ TTYC_HOME, TTYCODE_STRING, "home" },
{ TTYC_HPA, TTYCODE_STRING, "hpa" },
{ TTYC_ICH, TTYCODE_STRING, "ich" },
@@ -175,15 +176,17 @@
{ TTYC_SETAB, TTYCODE_STRING, "setab" },
{ TTYC_SETAF, TTYCODE_STRING, "setaf" },
{ TTYC_SGR0, TTYCODE_STRING, "sgr0" },
+ { TTYC_SITM, TTYCODE_STRING, "sitm" },
{ TTYC_SMACS, TTYCODE_STRING, "smacs" },
{ TTYC_SMCUP, TTYCODE_STRING, "smcup" },
{ TTYC_SMIR, TTYCODE_STRING, "smir" },
{ TTYC_SMKX, TTYCODE_STRING, "smkx" },
{ TTYC_SMSO, TTYCODE_STRING, "smso" },
{ TTYC_SMUL, TTYCODE_STRING, "smul" },
- { TTYC_SITM, TTYCODE_STRING, "sitm" },
+ { TTYC_TSL, TTYCODE_STRING, "tsl" },
{ TTYC_VPA, TTYCODE_STRING, "vpa" },
{ TTYC_XENL, TTYCODE_FLAG, "xenl" },
+ { TTYC_XT, TTYCODE_FLAG, "XT" },
};
char *
@@ -255,7 +258,7 @@
entstr[strlen(entstr) - 1] = '\0';
removeflag = 1;
} else
- continue;
+ val = xstrdup("");
for (i = 0; i < NTTYCODE; i++) {
ent = &tty_term_codes[i];
@@ -428,6 +431,18 @@
for (; acs[0] != '\0' && acs[1] != '\0'; acs += 2)
term->acs[(u_char) acs[0]][0] = acs[1];
+ /* On terminals with xterm titles (XT), fill in tsl and fsl. */
+ if (tty_term_flag(term, TTYC_XT) &&
+ !tty_term_has(term, TTYC_TSL) &&
+ !tty_term_has(term, TTYC_FSL)) {
+ code = &term->codes[TTYC_TSL];
+ code->value.string = xstrdup("\033]0;");
+ code->type = TTYCODE_STRING;
+ code = &term->codes[TTYC_FSL];
+ code->value.string = xstrdup("\007");
+ code->type = TTYCODE_STRING;
+ }
+
return (term);
error:
Index: tmux.h
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.h,v
retrieving revision 1.621
retrieving revision 1.622
diff -u -d -r1.621 -r1.622
--- tmux.h 25 Apr 2011 20:33:42 -0000 1.621
+++ tmux.h 18 May 2011 20:28:41 -0000 1.622
@@ -201,6 +201,7 @@
TTYC_EL, /* clr_eol, ce */
TTYC_EL1, /* clr_bol, cb */
TTYC_ENACS, /* ena_acs, eA */
+ TTYC_FSL, /* from_status_line, fsl */
TTYC_HOME, /* cursor_home, ho */
TTYC_HPA, /* column_address, ch */
TTYC_ICH, /* parm_ich, IC */
@@ -313,17 +314,19 @@
TTYC_SETAB, /* set_a_background, AB */
TTYC_SETAF, /* set_a_foreground, AF */
TTYC_SGR0, /* exit_attribute_mode, me */
+ TTYC_SITM, /* enter_italics_mode, it */
TTYC_SMACS, /* enter_alt_charset_mode, as */
TTYC_SMCUP, /* enter_ca_mode, ti */
TTYC_SMIR, /* enter_insert_mode, im */
TTYC_SMKX, /* keypad_xmit, ks */
TTYC_SMSO, /* enter_standout_mode, so */
TTYC_SMUL, /* enter_underline_mode, us */
- TTYC_SITM, /* enter_italics_mode, it */
+ TTYC_TSL, /* to_status_line, tsl */
TTYC_VPA, /* row_address, cv */
TTYC_XENL, /* eat_newline_glitch, xn */
+ TTYC_XT, /* xterm(1)-compatible title, XT */
};
-#define NTTYCODE (TTYC_XENL + 1)
+#define NTTYCODE (TTYC_XT + 1)
/* Termcap types. */
enum tty_code_type {
Index: tmux.1
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.1,v
retrieving revision 1.310
retrieving revision 1.311
diff -u -d -r1.310 -r1.311
--- tmux.1 25 Apr 2011 20:35:22 -0000 1.310
+++ tmux.1 18 May 2011 20:28:40 -0000 1.311
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 24 2011 $
+.Dd $Mdocdate: May 8 2011 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -2149,7 +2149,7 @@
.Ql colors
entry for terminals which support 88 or 256 colours:
.Bd -literal -offset indent
-"*88col*:colors=88,*256col*:colors=256"
+"*88col*:colors=88,*256col*:colors=256,xterm*:XT"
.Ed
.It Ic update-environment Ar variables
Set a space-separated string containing a list of environment variables to be
------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs