mirror of https://github.com/mpv-player/mpv
terminal-unix: don't read from stdin if it's not a terminal
I'm not quite sure what we should actually do (maybe read input commands?), but interpreting input as terminal key sequences is definitely weird. So just do nothing.
This commit is contained in:
parent
28fc13977e
commit
49a0b61880
|
@ -756,7 +756,7 @@ static void quit_request_sighandler(int signum)
|
||||||
|
|
||||||
static void *terminal_thread(void *ptr)
|
static void *terminal_thread(void *ptr)
|
||||||
{
|
{
|
||||||
bool stdin_ok = true; // if false, we still wait for SIGTERM
|
bool stdin_ok = isatty(STDIN_FILENO); // if false, we still wait for SIGTERM
|
||||||
while (1) {
|
while (1) {
|
||||||
struct pollfd fds[2] = {
|
struct pollfd fds[2] = {
|
||||||
{.events = POLLIN, .fd = death_pipe[0]},
|
{.events = POLLIN, .fd = death_pipe[0]},
|
||||||
|
|
Loading…
Reference in New Issue