Skip to content
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

Two-line prompts not respected #390

Closed
lightclient opened this issue May 20, 2020 · 7 comments · Fixed by #392
Closed

Two-line prompts not respected #390

lightclient opened this issue May 20, 2020 · 7 comments · Fixed by #392
Labels

Comments

@lightclient
Copy link

It seems like when a prompt is more than one line, the list of autocompletions is cutoff. See the following image for an example. Left is with a two line prompt, right is a one line prompt.

2020-05-20-1590005856_screenshot_1920x1080

In both cases, I doubled tapped tab after typing vim abc. Only the one line prompt properly displayed the potential completions in the directory.

@gwenn gwenn added the bug label May 21, 2020
@gwenn
Copy link
Collaborator

gwenn commented May 21, 2020

Also buggy with multiline input.

@gwenn
Copy link
Collaborator

gwenn commented May 21, 2020

@lightclient Could you please give PR #392 a try ?

@lightclient
Copy link
Author

@gwenn I'm still having issues after patching it into nushell 0.14.0 (see here).

@gwenn
Copy link
Collaborator

gwenn commented May 22, 2020

@lightclient Would you mind testing with rustyline example first ?

diff --git a/examples/example.rs b/examples/example.rs
index 2b3363f..916ba9c 100644
--- a/examples/example.rs
+++ b/examples/example.rs
@@ -102,7 +102,7 @@ fn main() -> rustyline::Result<()> {
     }
     let mut count = 1;
     loop {
-        let p = format!("{}> ", count);
+        let p = format!("{}\n> ", count);
         rl.helper_mut().expect("No helper").colored_prompt = format!("\x1b[1;32m{}\x1b[0m", p);
         let readline = rl.readline(&p);
         match readline {
rustyline % cargo run --example example
1
> target/debug/deps/libd
libdirs_next-b7bba4783d9fc177.rmeta      libdirs_sys_next-5fc98097bfbb9d7c.rmeta  libdirs_next-b7bba4783d9fc177.rlib
libdoc_comment-d8fc5586c1f80845.rlib     libdirs_sys_next-5fc98097bfbb9d7c.rlib   libdoc_comment-d8fc5586c1f80845.rmeta
1
> target/debug/deps/libd

@lightclient
Copy link
Author

I’m AFK until Monday, but will try then.

@lightclient
Copy link
Author

lightclient commented May 26, 2020

@gwenn thanks for sharing that code. I can confirm that #392 solves this issue in the rustyline example. I will need to spend some time debugging in nushell to better understand why it is still broken there. I will go ahead and close this issue for now.

@gwenn
Copy link
Collaborator

gwenn commented May 26, 2020

@lightclient I will also try to investigate with nushell if I have some spare time and keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants