Index: /trunk/include/iprt/mangling.h
===================================================================
--- /trunk/include/iprt/mangling.h	(revision 54723)
+++ /trunk/include/iprt/mangling.h	(revision 54724)
@@ -1475,4 +1475,5 @@
 # define RTStrmFlush                                    RT_MANGLER(RTStrmFlush)
 # define RTStrmGetCh                                    RT_MANGLER(RTStrmGetCh)
+# define RTStrmInputGetEchoChars                        RT_MANGLER(RTStrmInputGetEchoChars)
 # define RTStrmGetLine                                  RT_MANGLER(RTStrmGetLine)
 # define RTStrmOpen                                     RT_MANGLER(RTStrmOpen)
@@ -1486,4 +1487,5 @@
 # define RTStrmReadEx                                   RT_MANGLER(RTStrmReadEx)
 # define RTStrmRewind                                   RT_MANGLER(RTStrmRewind)
+# define RTStrmInputSetEchoChars                        RT_MANGLER(RTStrmInputSetEchoChars)
 # define RTStrmSetMode                                  RT_MANGLER(RTStrmSetMode)
 # define RTStrmWriteEx                                  RT_MANGLER(RTStrmWriteEx)
Index: /trunk/include/iprt/stream.h
===================================================================
--- /trunk/include/iprt/stream.h	(revision 54723)
+++ /trunk/include/iprt/stream.h	(revision 54724)
@@ -127,4 +127,24 @@
 
 /**
+ * Returns the current echo mode.
+ * This works only for standard input streams.
+ *
+ * @returns iprt status code.
+ * @param   pStream         The stream.
+ * @param   pfEchoChars     Where to store the flag whether typed characters are echoed.
+ */
+RTR3DECL(int) RTStrmInputGetEchoChars(PRTSTREAM pStream, bool *pfEchoChars);
+
+/**
+ * Changes the behavior for echoing inpit characters on the command line.
+ * This works only for standard input streams.
+ *
+ * @returns iprt status code.
+ * @param   pStream         The stream.
+ * @param   fEchoChars      Flag whether echoing typed characters is wanted.
+ */
+RTR3DECL(int) RTStrmInputSetEchoChars(PRTSTREAM pStream, bool fEchoChars);
+
+/**
  * Rewinds the stream.
  *
Index: /trunk/src/VBox/Runtime/r3/stream.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/stream.cpp	(revision 54723)
+++ /trunk/src/VBox/Runtime/r3/stream.cpp	(revision 54724)
@@ -59,4 +59,8 @@
 #ifdef RT_OS_WINDOWS
 # include <Windows.h>
+#endif
+#ifndef RT_OS_WINDOWS
+# include <termios.h>
+# include <unistd.h>
 #endif
 
@@ -462,4 +466,89 @@
 
     return VINF_SUCCESS;
+}
+
+
+RTR3DECL(int) RTStrmInputGetEchoChars(PRTSTREAM pStream, bool *pfEchoChars)
+{
+    int rc;
+
+    AssertPtrReturn(pStream, VERR_INVALID_HANDLE);
+    AssertReturn(pStream->u32Magic == RTSTREAM_MAGIC, VERR_INVALID_HANDLE);
+    AssertPtrReturn(pfEchoChars, VERR_INVALID_POINTER);
+
+    int fh = fileno(pStream->pFile);
+    if (isatty(fh))
+    {
+#ifdef RT_OS_WINDOWS
+        DWORD dwMode;
+        HANDLE hCon = (HANDLE)_get_osfhandle(fh);
+        if (GetConsoleMode(hCon, &dwMode))
+            *pfEchoChars = RT_BOOL(dwMode & ENABLE_ECHO_INPUT);
+        else
+            rc = RTErrConvertFromWin32(GetLastError());
+#else
+        struct termios Termios;
+
+        int rcPosix = tcgetattr(fh, &Termios);
+        if (!rcPosix)
+            *pfEchoChars = RT_BOOL(Termios.c_lflag & ECHO);
+        else
+            rc = RTErrConvertFromErrno(errno);
+#endif
+    }
+    else
+        rc = VERR_INVALID_HANDLE;
+
+    return rc;
+}
+
+
+RTR3DECL(int) RTStrmInputSetEchoChars(PRTSTREAM pStream, bool fEchoChars)
+{
+    int rc;
+
+    AssertPtrReturn(pStream, VERR_INVALID_HANDLE);
+    AssertReturn(pStream->u32Magic == RTSTREAM_MAGIC, VERR_INVALID_HANDLE);
+
+    int fh = fileno(pStream->pFile);
+    if (isatty(fh))
+    {
+#ifdef RT_OS_WINDOWS
+        DWORD dwMode;
+        HANDLE hCon = (HANDLE)_get_osfhandle(fh);
+        if (GetConsoleMode(hCon, &dwMode))
+        {
+            if (fEchoChars)
+                dwMode |= ENABLE_ECHO_INPUT;
+            else
+                dwMode &= ~ENABLE_ECHO_INPUT;
+            if (!SetConsoleMode(hCon, dwMode))
+                rc = RTErrConvertFromWin32(GetLastError());
+        }
+        else
+            rc = RTErrConvertFromWin32(GetLastError());
+#else
+        struct termios Termios;
+
+        int rcPosix = tcgetattr(fh, &Termios);
+        if (!rcPosix)
+        {
+            if (fEchoChars)
+                Termios.c_lflag |= ECHO;
+            else
+                Termios.c_lflag &= ~ECHO;
+
+            rcPosix = tcsetattr(fh, TCSAFLUSH, &Termios);
+            if (rcPosix != 0)
+                rc = RTErrConvertFromErrno(errno);
+        }
+        else
+            rc = RTErrConvertFromErrno(errno);
+#endif
+    }
+    else
+        rc = VERR_INVALID_HANDLE;
+
+    return rc;
 }
 
