-/* $OpenBSD: options-table.c,v 1.55 2015/04/19 21:34:21 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.56 2015/04/29 15:59:08 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
.default_num = 20
},
+ { .name = "default-terminal",
+ .type = OPTIONS_TABLE_STRING,
+ .default_str = "screen"
+ },
+
{ .name = "escape-time",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 0,
.default_str = _PATH_BSHELL
},
- { .name = "default-terminal",
- .type = OPTIONS_TABLE_STRING,
- .default_str = "screen"
- },
-
{ .name = "destroy-unattached",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
-/* $OpenBSD: server-fn.c,v 1.84 2015/04/24 23:17:11 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.85 2015/04/29 15:59:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
long pid;
if (s != NULL) {
- term = options_get_string(&s->options, "default-terminal");
+ term = options_get_string(&global_options, "default-terminal");
environ_set(env, "TERM", term);
idx = s->id;
-.\" $OpenBSD: tmux.1,v 1.424 2015/04/28 10:43:14 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.425 2015/04/29 15:59:08 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
.\" 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 28 2015 $
+.Dd $Mdocdate: April 29 2015 $
.Dt TMUX 1
.Os
.Sh NAME
Set the number of buffers; as new buffers are added to the top of the stack,
old ones are removed from the bottom if necessary to maintain this maximum
length.
+.It Ic default-terminal Ar terminal
+Set the default terminal for new windows created in this session - the
+default value of the
+.Ev TERM
+environment variable.
+For
+.Nm
+to work correctly, this
+.Em must
+be set to
+.Ql screen ,
+.Ql tmux
+or a derivative of them.
.It Ic escape-time Ar time
Set the time in milliseconds for which
.Nm
This option should be configured when
.Nm
is used as a login shell.
-.It Ic default-terminal Ar terminal
-Set the default terminal for new windows created in this session - the
-default value of the
-.Ev TERM
-environment variable.
-For
-.Nm
-to work correctly, this
-.Em must
-be set to
-.Ql screen
-or a derivative of it.
.It Xo Ic destroy-unattached
.Op Ic on | off
.Xc
-/* $OpenBSD: tty.c,v 1.179 2015/04/25 15:57:48 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.180 2015/04/29 15:59:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
void tty_read_callback(struct bufferevent *, void *);
void tty_error_callback(struct bufferevent *, short, void *);
+void tty_set_italics(struct tty *);
int tty_try_256(struct tty *, u_char, const char *);
void tty_colours(struct tty *, const struct grid_cell *);
tty->cx += width;
}
+void
+tty_set_italics(struct tty *tty)
+{
+ const char *s;
+
+ if (tty_term_has(tty->term, TTYC_SITM)) {
+ s = options_get_string(&global_options, "default-terminal");
+ if (strcmp(s, "screen") != 0 && strncmp(s, "screen-", 7) != 0) {
+ tty_putcode(tty, TTYC_SITM);
+ return;
+ }
+ }
+ tty_putcode(tty, TTYC_SMSO);
+}
+
void
tty_set_title(struct tty *tty, const char *title)
{
tty_putcode(tty, TTYC_BOLD);
if (changed & GRID_ATTR_DIM)
tty_putcode(tty, TTYC_DIM);
- if (changed & GRID_ATTR_ITALICS) {
- if (tty_term_has(tty->term, TTYC_SITM))
- tty_putcode(tty, TTYC_SITM);
- else
- tty_putcode(tty, TTYC_SMSO);
- }
+ if (changed & GRID_ATTR_ITALICS)
+ tty_set_italics(tty);
if (changed & GRID_ATTR_UNDERSCORE)
tty_putcode(tty, TTYC_SMUL);
if (changed & GRID_ATTR_BLINK)