Skip to content

Commit a04a3ba

Browse files
committed
fix(run): disable pty echo for interactive runtime input
1 parent 60644e2 commit a04a3ba

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/commands/run/RunProcess.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
#include <windows.h>
4545
#endif
4646

47+
#ifndef _WIN32
48+
#include <termios.h>
49+
#endif
50+
4751
using namespace vix::cli::style;
4852

4953
namespace vix::commands::RunCommand::detail
@@ -958,6 +962,16 @@ namespace vix::commands::RunCommand::detail
958962

959963
::setsid();
960964

965+
if (::isatty(slaveFd))
966+
{
967+
struct termios tty{};
968+
if (::tcgetattr(slaveFd, &tty) == 0)
969+
{
970+
tty.c_lflag &= ~ECHO;
971+
::tcsetattr(slaveFd, TCSANOW, &tty);
972+
}
973+
}
974+
961975
if (useSan)
962976
{
963977
::setenv("ASAN_OPTIONS",

0 commit comments

Comments
 (0)