Only do tty validation when using a NCursesUI

This commit is contained in:
Maxime Coste 2015-03-24 19:38:03 +00:00
parent 1b08b79989
commit 48007d5de2

View File

@ -243,6 +243,8 @@ void create_local_client(StringView init_command)
} }
}; };
if (std::is_same<UI, NCursesUI>::value)
{
if (not isatty(1)) if (not isatty(1))
throw runtime_error("stdout is not a tty"); throw runtime_error("stdout is not a tty");
@ -255,6 +257,7 @@ void create_local_client(StringView init_command)
close(tty); close(tty);
create_fifo_buffer("*stdin*", fd); create_fifo_buffer("*stdin*", fd);
} }
}
static Client* client = ClientManager::instance().create_client( static Client* client = ClientManager::instance().create_client(
make_unique<LocalUI>(), get_env_vars(), init_command); make_unique<LocalUI>(), get_env_vars(), init_command);