defuse / passgen

A password generator.
78 stars 25 forks source link

Clear Screen Automatically #18

Open defuse opened 10 years ago

defuse commented 10 years ago

I tend to leave terminals open after having run passgen and copy-pasted the password out. This means passwords that I think are safely locked away in my password manager are still displayed in a terminal amongst the dozens of open windows on my computer.

We should explore the idea of making passgen have a 60 second timer (displayed to the user), then run reset to clear the terminal. Also hook Ctrl+C to run reset.

Questions:

phillid commented 9 years ago

An option which doesn't require reset is sending a \r character, followed by a series of spaces to blank out the current line. Although, this wouldn't work if the terminal was less than the password length. Reset won't work either because it doesn't clear the scroll buffer. Perhaps the best option would be to use an ncurses screen, as this isn't kept in the scroll buffer, at least under terminal emulators

I have a few servers whose ttys are over RS-232, so I'll check their behavior with reset etc and edit this comment with results.