-
Notifications
You must be signed in to change notification settings - Fork 115
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
How can I get the cursor position #201
Comments
Well, I have a partial solution. Maybe someone who's more familiar with this library can get it across the finish line. Partial solutionuse console::Term;
fn main() {
let term = Term::stdout();
print!("\nsome filler text... please hit enter \x1b[6n");
let response = term.read_line().expect("failed to read response");
assert_eq!(response, ";38R"); // should be something like "\x1b[10;38R"
// not sure why row info is being cut off
term.clear_screen().expect("failed to clear screen");
print!("\nsome filler text... please hit enter \x1b[6n");
let response = term.read_line().expect("failed to read response");
assert_eq!(response, "38R"); // not sure why clearing the screen matters
} ExplanationPrinting the escape sequence As stated in
So, I would expect my partial solution to get a response like |
I'd love to see a Term method like |
I found issue #38, but it only adds the function to move the cursor. Could someone help me with this?
The text was updated successfully, but these errors were encountered: