mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 09:39:03 -04:00
don't try to preserve termios sans terminal
This commit is contained in:
parent
a4337ef144
commit
a0130a88e6
@ -186,10 +186,12 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname, unsigned utf8,
|
|||||||
unsigned noaltscreen, unsigned nocbreak){
|
unsigned noaltscreen, unsigned nocbreak){
|
||||||
memset(ti, 0, sizeof(*ti));
|
memset(ti, 0, sizeof(*ti));
|
||||||
ti->utf8 = utf8;
|
ti->utf8 = utf8;
|
||||||
|
if(fd >= 0){
|
||||||
if(tcgetattr(fd, &ti->tpreserved)){
|
if(tcgetattr(fd, &ti->tpreserved)){
|
||||||
fprintf(stderr, "Couldn't preserve terminal state for %d (%s)\n", fd, strerror(errno));
|
fprintf(stderr, "Couldn't preserve terminal state for %d (%s)\n", fd, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(ncinputlayer_init(&ti->input, stdin)){
|
if(ncinputlayer_init(&ti->input, stdin)){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user