reedline
reedline copied to clipboard
Column menu spaces don't respect special characters (accents, emojis...)
Platform Arch Linux Terminal software Konsole with nushell
Completion results can be shifted when a file/folder contains accents or emojis in nushell.
Steps to reproduce
With reedline
- Add the following commands in examples/completions.rs
"file0a".into(),
"file0b".into(),
"file0é".into(),
"file1a".into(),
"file1é".into(),
"file2a".into(),
"file2éééééééé".into(),
"file3a".into(),
- Run
cargo run --example completions - Type
f[TAB] - The columns are missing spaces for results with accents
With nushell
-
touch file0a file0b file0é file1a file1📁 file2a file2📁📁📁📁📁 file3a -
./[TAB](if it doesn't work, usels [TAB]or similar) - Same result
Screenshots/Screencaptures
Additional context
Changing .len() to .width() fix this
https://github.com/nushell/reedline/blob/a580ea56d4e5a889468b2969d2a1534379504ab6/src/menu/columnar_menu.rs#L657
Other .len() call could be replaced by .width() in this file:
- longest_suggestion
- shortest_base_string (in case all the results contains lots of special characters)
- maybe marker