summaryrefslogtreecommitdiffstats
path: root/osdep
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
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')
-rw-r--r--osdep/getch2.c3
-rw-r--r--osdep/getch2.h3
2 files changed, 6 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);
diff --git a/osdep/getch2.h b/osdep/getch2.h
index 016de5ae9e..49743f2ecf 100644
--- a/osdep/getch2.h
+++ b/osdep/getch2.h
@@ -5,6 +5,9 @@
extern int screen_width;
extern int screen_height;
+/* Termcap code to erase to end of line */
+extern char * erase_to_end_of_line;
+
/* Get screen-size using IOCTL call. */
extern void get_screen_size();