summaryrefslogtreecommitdiffstats
path: root/osdep/getch2.c
diff options
context:
space:
mode:
authorods15 <ods15@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-25 18:26:35 +0000
committerods15 <ods15@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-25 18:26:35 +0000
commit95db0aeb236eebd0f6c517078bc8df299599a02a (patch)
tree7386f41ecbd6c62600a3ffa7bb9bdf50ff4de86f /osdep/getch2.c
parentc1211b4370fd808b3784362631e5fc3e780686b0 (diff)
downloadmpv-95db0aeb236eebd0f6c517078bc8df299599a02a.tar.bz2
mpv-95db0aeb236eebd0f6c517078bc8df299599a02a.tar.xz
Use termcap "erase to end of line" character code instead of using spaces
to end of screen. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17241 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'osdep/getch2.c')
-rw-r--r--osdep/getch2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/osdep/getch2.c b/osdep/getch2.c
index e4a5c9cb1c..ac9c5e8395 100644
--- a/osdep/getch2.c
+++ b/osdep/getch2.c
@@ -40,6 +40,7 @@ static char getch2_buf[BUF_LEN];
int screen_width=80;
int screen_height=24;
+char * erase_to_end_of_line = "\033[J";
typedef struct {
int len;
@@ -78,6 +79,7 @@ char *p=tgetstr(id,&term_p);
static int success=0;
int load_termcap(char *termtype){
+ char * p;
if(!termtype) termtype=getenv("TERM");
if(!termtype) termtype="unknown";
success=tgetent(term_buffer, termtype);
@@ -88,6 +90,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;
+ if ((p = tgetstr("cd",&term_p))) erase_to_end_of_line=p;
termcap_add("kP",KEY_PGUP);
termcap_add("kN",KEY_PGDWN);