aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/term.c b/src/term.c
index e340edb6c17..77720779baf 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1,6 +1,6 @@
1/* Terminal control module for terminals described by TERMCAP 1/* Terminal control module for terminals described by TERMCAP
2 Copyright (C) 1985, 86, 87, 93, 94, 95, 98, 2000, 2001, 2002, 2005 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1998, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -245,6 +245,17 @@ tty_set_terminal_modes (struct device *display)
245 245
246 if (tty->output) 246 if (tty->output)
247 { 247 {
248 if (tty->TS_termcap_modes)
249 OUTPUT (tty, tty->TS_termcap_modes);
250 else
251 {
252 /* Output enough newlines to scroll all the old screen contents
253 off the screen, so it won't be overwritten and lost. */
254 int i;
255 for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++)
256 putchar ('\n');
257 }
258
248 OUTPUT_IF (tty, tty->TS_termcap_modes); 259 OUTPUT_IF (tty, tty->TS_termcap_modes);
249 OUTPUT_IF (tty, tty->TS_cursor_visible); 260 OUTPUT_IF (tty, tty->TS_cursor_visible);
250 OUTPUT_IF (tty, tty->TS_keypad_mode); 261 OUTPUT_IF (tty, tty->TS_keypad_mode);
@@ -1846,24 +1857,20 @@ turn_on_face (f, face_id)
1846 1857
1847 if (tty->TN_max_colors > 0) 1858 if (tty->TN_max_colors > 0)
1848 { 1859 {
1849 char *p; 1860 char *ts, *p;
1850 1861
1851 if (fg >= 0 && tty->TS_set_foreground) 1862 ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
1863 if (fg >= 0 && ts)
1852 { 1864 {
1853 if (tty->standout_mode) 1865 p = tparam (ts, NULL, 0, (int) fg);
1854 p = tparam (tty->TS_set_background, NULL, 0, (int) fg);
1855 else
1856 p = tparam (tty->TS_set_foreground, NULL, 0, (int) fg);
1857 OUTPUT (tty, p); 1866 OUTPUT (tty, p);
1858 xfree (p); 1867 xfree (p);
1859 } 1868 }
1860 1869
1861 if (bg >= 0 && tty->TS_set_background) 1870 ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
1871 if (bg >= 0 && ts)
1862 { 1872 {
1863 if (tty->standout_mode) 1873 p = tparam (ts, NULL, 0, (int) bg);
1864 p = tparam (tty->TS_set_foreground, NULL, 0, (int) bg);
1865 else
1866 p = tparam (tty->TS_set_background, NULL, 0, (int) bg);
1867 OUTPUT (tty, p); 1874 OUTPUT (tty, p);
1868 xfree (p); 1875 xfree (p);
1869 } 1876 }