mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 12:31:45 +08:00
Add fallback backspace in case tgetstr("le") fails.
This commit is contained in:
parent
98b846c8b1
commit
ceb1995733
@ -238,10 +238,12 @@ static void tty_info(void)
|
|||||||
if ((term = getenv("TERM")) == NULL)
|
if ((term = getenv("TERM")) == NULL)
|
||||||
term = "dumb";
|
term = "dumb";
|
||||||
if (-1 != tgetent(buff, term)) {
|
if (-1 != tgetent(buff, term)) {
|
||||||
if ((backspace = tgetstr("le", &bp)) != NULL)
|
if ((backspace = tgetstr("le", &bp)) != NULL)
|
||||||
backspace = strdup(backspace);
|
backspace = strdup(backspace);
|
||||||
tty_cols = tgetnum("co");
|
else
|
||||||
tty_rows = tgetnum("li");
|
backspace = "\b";
|
||||||
|
tty_cols = tgetnum("co");
|
||||||
|
tty_rows = tgetnum("li");
|
||||||
}
|
}
|
||||||
/* Make sure to check width & rows and fallback to TIOCGWINSZ if available. */
|
/* Make sure to check width & rows and fallback to TIOCGWINSZ if available. */
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user