summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-08-13 05:54:56 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-08-13 06:06:29 +0300
commite107cf785132418cc658e1cee4ad814e17eac886 (patch)
treea9aa9d1d440780dc722144431b43648475e300dd /osdep
parente09fe1ce0413609b891f4abf2f5df5f1996622a0 (diff)
downloadmpv-e107cf785132418cc658e1cee4ad814e17eac886.tar.bz2
mpv-e107cf785132418cc658e1cee4ad814e17eac886.tar.xz
Use correct terminal "clear line" code
The "erase_to_end_of_line" string used to clear the terminal status line was initialized with the termcap id "cd", which means to clear all lines below the cursor. Change it to the correct "ce" to clear the current line. Usually the status line is on the bottommost line of the terminal so the behaviour wouldn't differ much. However it did make a difference when I tested starting MPlayer at the top of a huge gnome-terminal window so the status line was not at the bottom; in that case clearing just the current line used less CPU than clearing the part of the huge window below the status line.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/getch2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/osdep/getch2.c b/osdep/getch2.c
index 51ef8c77f0..797c02b8dc 100644
--- a/osdep/getch2.c
+++ b/osdep/getch2.c
@@ -96,7 +96,7 @@ int load_termcap(char *termtype){
screen_height=tgetnum("li");
if(screen_width<1 || screen_width>255) screen_width=80;
if(screen_height<1 || screen_height>255) screen_height=24;
- erase_to_end_of_line= tgetstr("cd",&term_p);
+ erase_to_end_of_line= tgetstr("ce",&term_p);
termcap_add("kP",KEY_PGUP);
termcap_add("kN",KEY_PGDWN);