aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index d57fe146fc0..d8422b839f9 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1322,6 +1322,9 @@ static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1};
1322static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1}; 1322static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
1323#endif 1323#endif
1324 1324
1325/* Initialize the terminal mode on all tty devices that are currently
1326 open. */
1327
1325void 1328void
1326init_all_sys_modes (void) 1329init_all_sys_modes (void)
1327{ 1330{
@@ -1330,6 +1333,8 @@ init_all_sys_modes (void)
1330 init_sys_modes (tty); 1333 init_sys_modes (tty);
1331} 1334}
1332 1335
1336/* Initialize the terminal mode on the given tty device. */
1337
1333void 1338void
1334init_sys_modes (tty_out) 1339init_sys_modes (tty_out)
1335 struct tty_display_info *tty_out; 1340 struct tty_display_info *tty_out;
@@ -1833,6 +1838,9 @@ set_window_size (fd, height, width)
1833} 1838}
1834 1839
1835 1840
1841
1842/* Prepare all terminal devices for exiting Emacs. */
1843
1836void 1844void
1837reset_all_sys_modes (void) 1845reset_all_sys_modes (void)
1838{ 1846{
@@ -1843,6 +1851,7 @@ reset_all_sys_modes (void)
1843 1851
1844/* Prepare the terminal for closing it; move the cursor to the 1852/* Prepare the terminal for closing it; move the cursor to the
1845 bottom of the frame, turn off interrupt-driven I/O, etc. */ 1853 bottom of the frame, turn off interrupt-driven I/O, etc. */
1854
1846void 1855void
1847reset_sys_modes (tty_out) 1856reset_sys_modes (tty_out)
1848 struct tty_display_info *tty_out; 1857 struct tty_display_info *tty_out;
@@ -1854,11 +1863,27 @@ reset_sys_modes (tty_out)
1854 } 1863 }
1855 if (!tty_out->term_initted) 1864 if (!tty_out->term_initted)
1856 return; 1865 return;
1857 1866
1867 /* Go to and clear the last line of the terminal. */
1868
1858 cmgoto (tty_out, FrameRows (tty_out) - 1, 0); 1869 cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
1859#if 0 /* XXX This doesn't work anymore, the signature has changed. */ 1870
1860 tty_clear_end_of_line (tty_out, FrameCols (tty_out)); 1871 /* Code adapted from tty_clear_end_of_line. */
1861#endif 1872 if (tty_out->TS_clr_line)
1873 {
1874 emacs_tputs (tty_out, tty_out->TS_clr_line, 1, cmputc);
1875 }
1876 else
1877 { /* have to do it the hard way */
1878 int i;
1879 turn_off_insert (tty_out);
1880
1881 for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++)
1882 {
1883 fputc (' ', TTY_OUTPUT (tty_out));
1884 }
1885 }
1886
1862 cmgoto (tty_out, FrameRows (tty_out) - 1, 0); 1887 cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
1863 fflush (tty_out->output); 1888 fflush (tty_out->output);
1864 1889