diff --git a/src/chat/flags.c b/src/chat/flags.c index 6126dca..7855ee1 100644 --- a/src/chat/flags.c +++ b/src/chat/flags.c @@ -18,11 +18,27 @@ along with this program. If not, see . #include +#include +#include + why2_bool asking_password = 0; void __why2_set_asking_password(why2_bool value) { asking_password = value; + + struct termios tty; + tcgetattr(STDIN_FILENO, &tty); //GET ATTRS + + if (!value) + { + tty.c_lflag |= ECHO; //DISABLE + } else + { + tty.c_lflag &= ~ECHO; //ENABLE + } + + tcsetattr(STDIN_FILENO, TCSANOW, &tty); //SET ATTRS } why2_bool __why2_get_asking_password()