Rendering issue with ColumnarMenu and Suggestions that have a description
Platform I found this on Windows 11, but believe it to be not specific. Terminal software Windows Terminal, both nushell and powershell
Describe the problem you are observing.
Steps to reproduce
- create a sample program that shows the issue. The fastest way to do this is to use the "completions" example in the repo. The only problem is, it uses the DeafultCompleter, which doesn't take descriptions for the completion items. However, we can apply a very small diff to reedline itself:
diff --git a/src/completion/default.rs b/src/completion/default.rs
index 812c740..d4ac027 100644
--- a/src/completion/default.rs
+++ b/src/completion/default.rs
@@ -98,7 +98,7 @@ impl Completer for DefaultCompleter {
Suggestion {
value: format!("{}{}", span_line, ext),
- description: None,
+ description: Some(String::from("extra")),
extra: None,
span,
append_whitespace: false,
And now cargo run --example completions will show the issue.
- Run the example
- type "he" and then hit tab
The very first time you do this, you'll get weird rendering:
If you hit tab again, or an arrow key, or anything else, it'll fix itself:
and then on future renderings, it does the right thing.
This makes me really suspect it's some initial state being set up just incorrectly, but have not yet tried to actually diagnose the issue.
Good catch! menus are witchcraft, confirmed Can confirm that annoying behavior on Ubuntu/WSL. Can look into it in a few days.
I'm also hitting this issue:
And after pressing tab it will fix itself just like the OP: