* Enables or disables the terminal input echo flag. This * is used to mask password input. * * @param echo Boolean, if true the console input will be echoed to console */
| 169 | * @param echo Boolean, if true the console input will be echoed to console |
| 170 | */ |
| 171 | void set_console_echo(bool echo) |
| 172 | { |
| 173 | struct termios console; |
| 174 | tcgetattr(STDIN_FILENO, &console); |
| 175 | if (echo) |
| 176 | { |
| 177 | console.c_lflag |= ECHO; |
| 178 | } |
| 179 | else |
| 180 | { |
| 181 | console.c_lflag &= ~ECHO; |
| 182 | } |
| 183 | tcsetattr(STDIN_FILENO, TCSANOW, &console); |
| 184 | } |
| 185 | |
| 186 | |
| 187 | std::string get_local_tstamp(const std::time_t epoch) |