-
Notifications
You must be signed in to change notification settings - Fork 310
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
pcli threshold sign
hangs when pasting input into the terminal
#4230
Comments
On multiple linux machines with bash, I have never observed this behavior. Will try linux & fish too, see if we can narrow it down. |
I tried using the standard MacOS terminal and also, incredibly frustratingly, experienced this while trying to use
|
chatgpt Certainly! Below is an example using Rust and the Termion crate, where the program enters cbreak mode, reads a single line from standard input, and then returns the terminal to its original state: extern crate termion;
use termion::input::TermRead;
use termion::raw::IntoRawMode;
use std::io::{self, Write};
fn main() {
// Set up the terminal in cbreak mode
let stdin = io::stdin();
let mut stdout = io::stdout().into_raw_mode().unwrap();
writeln!(stdout, "Please enter a line: ").unwrap();
stdout.flush().unwrap();
// Read a single line
if let Some(Ok(line)) = stdin.lock().lines().next() {
writeln!(stdout, "You entered: {}", line).unwrap();
} else {
writeln!(stdout, "Error reading line").unwrap();
}
// Terminal will be restored to its original state when `stdout` is dropped.
} In this code, |
## Describe your changes Cherry picks 1376d4b onto the 0.73 release branch so that we can deploy a patch release of pcli ahead of a network upgrade. ## Issue ticket number and link #4230 ## Checklist before requesting a review - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > only changes the pcli terminal handling
Describe the bug
pcli threshold sign
hangs when pasting a message in (on MacOS, using ITerm2 andfish
, if that turns out to matter)To Reproduce
Steps to reproduce the behavior:
pcli threshold sign
I'm expecting this is something about the way we're reading data from the terminal.
The text was updated successfully, but these errors were encountered: