`fh login` does not properly read token at the prompt
When pasting the FlakeHub token at the `fh login` prompt, the input isn't read properly.
I first see a prompt without cursor:
```console
$ fh login
Log in to FlakeHub: https://flakehub.com/token/create?description=FlakeHub+CLI+on+...
And then follow the prompts below:
> Paste your token here:
```
Then, after pasting, the input line is garbled and the prompt appears again, this time with `********` characters:
```console
$ fh login
Log in to FlakeHub: https://flakehub.com/token/create?description=FlakeHub+CLI+on+...
And then follow the prompts below:
akehub1_redactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredactedredacted> Paste your token here: ********
Error:
0: Checking the validity of the provided token
1: The provided token was invalid. Please try again, or contact support@flakehub.com if the problem persists.
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Consider reporting this error using this URL: https://github.com/DeterminateSystems/fh/issues/new?...
```
<img width="306" alt="Image" src="https://github.com/user-attachments/assets/12b127e7-ee1c-4de0-8af6-ba089c29aab8" />
In the screenshot above, the second prompt seems to appear at the beginning of a new line, but when I copy the text on screen there is no newline character before that prompt.
I think the program is trying to adjust to the terminal's current width.
After the command returns, my cursor does not come back and I have to issue a `reset` command to fix my terminal.
Shell: zsh 5.9 (aarch64-apple-darwin24.2.0)
Terminal: wezterm 20250116-151613-6c443bee
## Metadata
|key|value|
|--|--|
|**version**|0.1.21|
|**os**|macos|
|**arch**|aarch64|
3 条评论