| Link | stdin_hidden |
| Author | Ke Carlton |
| Category | Action |
| Version | 9.x |
| License | Public Domain |
| Posted | 31 Aug 2012 |
| Updated | 31 Aug 2012 |
| More by this author... | |
#!/usr/bin/lasso9
define stdin_hidden...
local(p)
while(not #p) => {
#p = stdin_hidden('What is your password?')
}
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define stdin_hidden(prompt::string='Please enter your password:') => {
local(
esc = decode_base64('Gw=='),
cap = currentcapture
)
// Clear conceal flag
handle => { stdout(#esc + '[0;0;28m') }
// Set hidden flag
stdout(#prompt + ' ' + #esc + '[30;40;1;8m')
// Wait for input
local(r) = file_stdin->readsomebytes(1024,100)
while(not #r or #r->size == 0) => {
#r = file_stdin->readSomeBytes(1024, 1000)
}
// Cursor up
stdout(#esc + '[1F')
// Cursor right
stdout(#esc + '['+#prompt->size->asstring+'C')
// Delete hidden password
stdoutnl(#esc + '[0K')
// Return input
return #r
}
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft