mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Disable stdout buffering globally
This makes it possible to pipe output to other programs cleanly.
This commit is contained in:
parent
6aca9ffee5
commit
c94cce53ff
2 changed files with 4 additions and 4 deletions
|
|
@ -61,6 +61,10 @@ int main(int argc, char *argv[])
|
|||
/* Configure tty device */
|
||||
tty_configure();
|
||||
|
||||
/* Disable line buffering in stdout. This is necessary if we
|
||||
* want things like local echo to work correctly. */
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Configure input terminal */
|
||||
if (isatty(fileno(stdin)))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1184,10 +1184,6 @@ void stdout_configure(void)
|
|||
{
|
||||
int status;
|
||||
|
||||
/* Disable line buffering in stdout. This is necessary if we
|
||||
* want things like local echo to work correctly. */
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Save current stdout settings */
|
||||
if (tcgetattr(STDOUT_FILENO, &stdout_old) < 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue