summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/term.c b/src/term.c
index 1059b0669a7..6651b967927 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2169,6 +2169,14 @@ set_tty_color_mode (struct tty_display_info *tty, struct frame *f)
#endif /* !DOS_NT */
+char *
+tty_type_name (Lisp_Object terminal)
+{
+ struct terminal *t = decode_tty_terminal (terminal);
+
+ return t? t->display_info.tty->type: NULL;
+}
+
DEFUN ("tty-type", Ftty_type, Stty_type, 0, 1, 0,
doc: /* Return the type of the tty device that TERMINAL uses.
Returns nil if TERMINAL is not on a tty device.
@@ -2177,10 +2185,9 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). */)
(Lisp_Object terminal)
{
- struct terminal *t = decode_tty_terminal (terminal);
+ char *name = tty_type_name (terminal);
- return (t && t->display_info.tty->type
- ? build_string (t->display_info.tty->type) : Qnil);
+ return (name? build_string (name) : Qnil);
}
DEFUN ("controlling-tty-p", Fcontrolling_tty_p, Scontrolling_tty_p, 0, 1, 0,
@@ -2356,9 +2363,7 @@ frame's terminal). */)
was suspended. */
get_tty_size (fileno (t->display_info.tty->input), &width, &height);
if (width != old_width || height != old_height)
- change_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f)
- - FRAME_TAB_BAR_LINES (f),
- 0, 0, 0, 0);
+ change_frame_size (f, width, height, false, false, false);
SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
}