summaryrefslogtreecommitdiffstats
path: root/osdep/terminal-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/terminal-unix.c')
-rw-r--r--osdep/terminal-unix.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c
index 193cd8557f..de7087b9b8 100644
--- a/osdep/terminal-unix.c
+++ b/osdep/terminal-unix.c
@@ -56,7 +56,8 @@ static volatile int tio_orig_set;
int screen_width = 80;
int screen_height = 24;
-char * erase_to_end_of_line = NULL;
+char *terminal_erase_to_end_of_line = "\033[A";
+char *terminal_cursor_up = "\033[K";
typedef struct {
char *cap;
@@ -267,10 +268,16 @@ static int load_termcap(char *termtype){
#endif
ensure_cap(&termcap_buf, 2048);
- static char term_buf[64];
+ static char term_buf[128];
char *buf_ptr = &term_buf[0];
-
- erase_to_end_of_line = tgetstr("ce", &buf_ptr);
+ char *tmp;
+
+ tmp = tgetstr("ce", &buf_ptr);
+ if (tmp)
+ terminal_erase_to_end_of_line = tmp;
+ tmp = tgetstr("ku", &buf_ptr);
+ if (tmp)
+ terminal_cursor_up = tmp;
screen_width = tgetnum("co");
screen_height = tgetnum("li");