by briansteffens · 9y ago · 0 comments
I've been messing around with a little text editor component myself in golang:
https://github.com/briansteffens/tui/blob/master/editbox.go
For a SQL editor project:
It is surprisingly tricky to get right. There used to be a POSIX function in the c standard library - "getpass" to handle this but the implementation was not thread safe and thus it was depreciated from posix spec - the only portable way I know to do this is to "roll your own code" using termios - not ideal.
see: http://man7.org/linux/man-pages/man3/getpass.3.html note the comment: "This function is obsolete. Do not use it" - there is a heap of potentially vulnerable code out in the wild that uses getpass.