Open D3N14L opened 1 year ago
Weird, we use std::io::BufReader
in a fairly straightforward way; I wouldn't expect it to block indefinitely at 1024 bytes. I'll take a look...
Weird, we use
std::io::BufReader
in a fairly straightforward way; I wouldn't expect it to block indefinitely at 1024 bytes. I'll take a look...
@cyphar I analyze the reasons for this limitation and provide possible solutions at https://github.com/cyphar/paperback/issues/71.
(Comment by @YouXam, from #71.)
Description
On macOS, there appears to be an issue when attempting to input a complete set of QR code data into the terminal in a single line. The macOS terminal input is restricted to 1024 characters as defined by the system limits (source). Once 1024 characters have been entered on a single line, any further input (including the Enter key) is not accepted. Typically, the data extracted from QR codes exceeds this 1024-character limit. As a result, this limitation forces users to engage in inconvenient and confusing multiple manual copy-paste operations to input the entire data string.
Possible Solutions
1. Modify the QR code generation process to output data in multiple lines rather than a single long line. This approach can help users to more easily handle and input data within the limitations of the macOS terminal character count. 2. Explore using libraries like [rustyline](https://github.com/kkawakam/rustyline) which might allow bypassing the 1024 character limit per line. This could provide a more seamless input experience for users dealing with lengthy single-line data.
This issue is particularly critical as the program necessitates the entry of large amounts of data, making it inevitable for macOS users to face this limitation. Users unfamiliar with this system constraint might not understand why they are unable to input data successfully, leading to significant usability concerns.
We hope this issue can be prioritized for a resolution to enhance the functionality and user experience of macOS terminal operations. Thank you for your attention and looking forward to any updates or feedback from the development team.
@YouXam It wasn't necessary to open a new issue :sweat_smile:.
We could add new lines to the QR codes, but because of how QR codes are encoded, adding a character from outside the character set we use will waste more space than just a single character (the encoder has to specify two extra encoding changes as well as the newline itself).
FWIW, the goal of paperback is to have a user-friendly GUI so that non-technical folks can do recovery and other necessary operations. Since the GUI is going to be the primary method of using paperback, the limitations of MacOS's terminal shouldn't affect things like how we encode data IMHO.
However, if switching to unbuffered mode (and using a readline-like library for input) also solves the issue, we can do that.
@YouXam It wasn't necessary to open a new issue 😅.
We could add new lines to the QR codes, but because of how QR codes are encoded, adding a character from outside the character set we use will waste more space than just a single character (the encoder has to specify two extra encoding changes as well as the newline itself).
FWIW, the goal of paperback is to have a user-friendly GUI so that non-technical folks can do recovery and other necessary operations. Since the GUI is going to be the primary method of using paperback, the limitations of MacOS's terminal shouldn't affect things like how we encode data IMHO.
However, if switching to unbuffered mode (and using a readline-like library for input) also solves the issue, we can do that.
Is there currently a plan to develop a GUI program?
Is there currently a plan to develop a GUI program?
There is a plan to do that but this is currently a one-man project and I don't have a lot of time to work on it. (There are also some currently-unsolved questions -- there doesn't appear to be an easy library to use to scan for QR codes. I guess we could use some machine-vision libraries but idk how painful it would be to use them with Rust. And if we were to use OpenCV then we're stuck with Python which can't be used for mobile applications without extreme amounts of effort.)
I suspect the most obvious solution would be to create a mobile application, since scanning QR codes with a phone is more user-friendly than on a computer.
Problem description
When pasting more than 1023 chars into the recovery input, the command stalls after 1024 chars and does not accept any more key presses.
How to reproduce
Workaround
Use
pbpaste | fold -w 1023
to split the Main Document line into lines of (max) 1023 chars length and paste the ouput into the recovery command:Build Env