-
-
Notifications
You must be signed in to change notification settings - Fork 206
Use a wider window to show the secrets #1543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a wider window to show the secrets #1543
Conversation
|
fold is a normally shipped Linux command which permits to spread output on multiple lines when displayed to user. You can try it on from shell command line on common Linux OSes by default. String="This is a really too long string of too many characters that won't display on a single line to be shown on a single line and needs to be folded to be showed correctly without hacking around" echo "$String" | fold Fold accepts parameters, which are different from busybox. Drop on recovery shell and try fold --help, but busybox replicates standard usage without parameters. https://linux.die.net/man/1/fold Standard width is 80 characters which is pretty standard and will work with older 1076 width screens and should not need to be worked around. We cannot imply fixed width under Heads console or whiptail UX. |
|
Thanks for the clarification! Changed to fold-based solution now; tested in recovery shell of NK Heads 2.1. |
|
Thanks for checking this out! I think this needs Adding echo -e might compound problems if passphrases themselves contain I didn't test any of it, that's what it looks like from review, please correct me if I missed something 😉 IMO, I don't think we need to fold to WIDTH-20 (=60) columns, I think we can use all 80 columns. With 60 columns, some reasonable-length passphrases will word wrap unnecessarily. We're spending 35 chars on |
This partially fixes linuxboot#1537, but while the increased width wouldn't be a problem on the NV41 AFAICT, I don't know about other machines. I don't know what @tlaurion means with "busybox's folding", which may be a better solution. Signed-off-by: Christian Foerster <christian.foerster@mailfence.com>
Uses fold on the entire passphrase string now; tested in recovery shell of NK Heads 2.1. Reverted change of WIDTH parameter (first commit of this PR). Signed-off-by: Christian Foerster <christian.foerster@mailfence.com>
Signed-off-by: Christian Foerster <christian.foerster@mailfence.com>
d246b18 to
ce2abd4
Compare
|
@JonathonHall-Purism Thank you for the feedback! You are right about I also rebased and signed off now. |
JonathonHall-Purism
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! @tlaurion any objections?
|
Calculations seem right, cannot test but should be improvement nonetheless. Merging |
This partially fixes #1537, but while the increased width wouldn't be a problem on the NV41 AFAICT, I don't know about other machines.
I don't know what @tlaurion means with "busybox's folding", which may be a better solution.