passgen icon indicating copy to clipboard operation
passgen copied to clipboard

Clear Screen Automatically

Open defuse opened this issue 10 years ago • 1 comments

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:

  • Is reset actually reliable? Surely the password would still be in memory somewhere?
  • Would it be too much of a usability issue?
  • How do you get a reset-like effect in different terminals (passgen might be run without a terminal at all, consider this use case as well).

defuse avatar Jul 23 '14 15:07 defuse

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.

phillid avatar Nov 01 '14 03:11 phillid