Show characters typed in decrypt-backup
This PR addresses the improvement request to show characters typed in decrypt-backup as asterisks (*), so that people can follow the characters they typed (#581)
The rich library currently used by MVT does seem to support this feature.
password = Prompt.ask("Enter backup password", password=True) # rich library
The builtin password support of the library leads to the characters being completely hidden.
Using the popular promt_toolkit instead:
prompt('Enter backup password: ', is_password=True) #
# > Enter backup password: *******
When the is_password=True flag has been given, the input is replaced by asterisks (* characters).
The downside is that another library is used for password inputs. However, this is a fairly simple solution for the issue.
Alternatively, one could also try and write a custom password prompt using the rich library.
Hi, thanks for your contribution. This would be a useful feature but it requires an additional library prompt_toolkit. We are trying to limit external libraries used by MVT, so I am not sure a library is worth adding only for it. I am keeping this open tho in case others have different opinions.
Understandable. Maybe the rich library will implement a customization for the password prompt, one could consider adding it as a feature request.
Discussion in the rich project regarding this feature here: https://github.com/Textualize/rich/discussions/3726