[fpc-pascal] Readln a password

Adriaan van Os fpc at microbizz.nl
Sun Nov 27 17:29:35 CET 2016


> Dmitry Boyarintsev wrote:
> 
>> I'd think you want something simlar on unix.
>> Take a look at man 4 termios
>> specifically at local flag named "ECHO".
>> you want to disable it via tcsetattr() Â (TermIO unit)
> 
> Thanks for the hint. I haven't yet tried it, but I would expect it to fail,as stty (see stty.c in 
> GNU coreutils) calls tcsetattr and stty fails reporting 'stty: stdin isn't a terminal' .

No, it was my own fault. I were executing '/bin/stty -echo' with AssignStreams and then StdIn is 
indeed not a terminal, but a pipe. When I execute it normally, then stty does work, so I expect 
tcsetattr to work too.

So, we can now use Readln without echoing in Terminal.app. There is still echoing to the Xcode 
Console window, but let's assume that is a bug or limitation of Xcode.

Maybe something to add to the fpc runtime libs ?

Regards,

Adriaan van Os




More information about the fpc-pascal mailing list