Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在MinTTY下关闭echo?_C_Windows_Shell_Mintty - Fatal编程技术网

如何在MinTTY下关闭echo?

如何在MinTTY下关闭echo?,c,windows,shell,mintty,C,Windows,Shell,Mintty,我有一个在MinTTY(cygwin的shell)下运行的程序,调用GetConsoleMode/SetConsoleMode失败\u getch也会回显到控制台。这是一个本机win32应用程序,没有绑定到cygwin环境,因此任何cygwin函数都将失效。如何关闭回音以便输入密码?我基本上通过popen模拟了以下内容: save_state=$(stty -g) /bin/echo -n "Account: " read acct /bin/echo -n "Password: " stty

我有一个在MinTTY(cygwin的shell)下运行的程序,调用
GetConsoleMode
/
SetConsoleMode
失败<代码>\u getch也会回显到控制台。这是一个本机win32应用程序,没有绑定到cygwin环境,因此任何cygwin函数都将失效。如何关闭回音以便输入密码?

我基本上通过
popen
模拟了以下内容:

save_state=$(stty -g) /bin/echo -n "Account: " read acct /bin/echo -n "Password: " stty -echo read password # this won't echo stty "$save_state" echo "" echo account = $acct and password = $password Read more at http://www.askdavetaylor.com/how_to_read_password_without_echoing_c.html#Z3FtcTtMHe0gJdES.99 保存状态=$(stty-g) /bin/echo-n“帐户:” 阅读账户 /bin/echo-n“密码:” stty-echo 读取密码#这不会回显 stty“$save_state” 回声“” echo帐户=$acct和密码=$password 阅读更多http://www.askdavetaylor.com/how_to_read_password_without_echoing_c.html#Z3FtcTtMHe0gJdES.99
我基本上通过
popen
模拟了以下内容:

save_state=$(stty -g) /bin/echo -n "Account: " read acct /bin/echo -n "Password: " stty -echo read password # this won't echo stty "$save_state" echo "" echo account = $acct and password = $password Read more at http://www.askdavetaylor.com/how_to_read_password_without_echoing_c.html#Z3FtcTtMHe0gJdES.99 保存状态=$(stty-g) /bin/echo-n“帐户:” 阅读账户 /bin/echo-n“密码:” stty-echo 读取密码#这不会回显 stty“$save_state” 回声“” echo帐户=$acct和密码=$password 阅读更多http://www.askdavetaylor.com/how_to_read_password_without_echoing_c.html#Z3FtcTtMHe0gJdES.99