How to hide user input in a console application?

Hello,

If I write the following in a Terminal window, the next typed characters are hidden (like for entering a password):
stty -echo
(re-enabled with “stty echo”).
In my Xojo console application, I tried “stdout.Write “stty -echo” [stdout.write EndOfLine]"” and “Print “stty -echo” [Print EndOfLine]"” (in bracket, optional tries). They just print the passed text without “executing” it. Why is that different?

Stdout.write and Print just send characters to the console window, the same way echo would do in the terminal.

OK, thanks.
When in comes to the Terminal, I can use commands and understand “grammar”, but the underlying mechanism is something I can’t understand as of now. How would I pass commands such as “stty -echo" from inside my console application?

You want an non echoing stdin?

Our StdinMBS class in MBS Xojo Util Plugin has an echo property you may want to try.

When my console application asks for a password, using the “Input” command, I want the entered password to be hidden from the screen (like with the usual Terminal app). I’m not sure how this is called, since I’m not a Unix expert.

As simple as StdinMBS.Echo=false (not even needed to use StdinMBS for all other interactions)!
Thank you!