Skip to main content
added 39 characters in body
Source Link

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep 10;stty sane;./my_program.

Using raw, avoid CtrlC CtrlZ to interfere. Sane imply echo and revert the terminal to a sane mode.

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep 10;stty sane;./my_program.

Using raw, avoid CtrlC CtrlZ to interfere. Sane imply echo.

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep 10;stty sane;./my_program.

Using raw, avoid CtrlC CtrlZ to interfere. Sane imply echo and revert the terminal to a sane mode.

Post Undeleted by Frédéric Loyer
Post Deleted by Frédéric Loyer
deleted 5 characters in body
Source Link

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep 10;stty sane echo;sane;./my_program.

Using raw, avoid CtrlC CtrlZ to interfere. Sane imply echo.

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep 10;stty sane echo;./my_program.

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep 10;stty sane;./my_program.

Using raw, avoid CtrlC CtrlZ to interfere. Sane imply echo.

added 10 characters in body
Source Link

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep10;sttyecho;sleep 10;stty sane echo;./my_program.

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty -echo;sleep10;stty echo;./my_program.

stty -echo disable the echo of your terminal, but if you type something, it will be memorized and the shell will get the typed key.

Then, before leaving, stty echo (revert back the echo mode), and drain the terminal input with this program :

#include <stdio.h>
#include <unistd.h>
#include <termios.h>

int main(void)
{
    tcflush(0, TCIFLUSH);
    return 0;
}

The whole thing would be stty raw -echo;sleep 10;stty sane echo;./my_program.

Source Link
Loading