You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to cause a panic when autocompleting the file name
A very practical example - when having two files called Лекція 1.docx and Лекція 2.docx in the same directory, trying any of the following autocompletes causes a panic: ls Л<Tab>ls Ле<Tab> ... ls Лекція<Tab>
(using ls is purely demonstrative, autocompleting in any context causes a panic)
Curiously enough, the panic happens only when the last character of user's prefix is non-ASCII - for two files ТестTest 1 and ТестTest 2, autocompleting ls Те<Tab> panics, but ls ТестTes<Tab> does not
This does not happen if you autocomplete with quotes: ls "Лекц<Tab>" does not cause a panic
The text of the panic itself (after attempting ls При<Tab>) (also occasionally the panic is only seen for a second and then disappears, can't pinpoint why):
× Main thread panicked.
├─▶ at /usr/src/debug/rust/rustc-1.84.1-src/library/core/src/str/
│ mod.rs:648:21
╰─▶ byte index 6 is not a char boundary; it is inside 'и' (bytes 5..7) of
``Пример 1``
How to reproduce
Here is a script generating useful examples
mkdir example
cd example
touch "Пример 1""Пример 2"# Example
touch "例 1""例 2"# Example
touch "gggффф 1""gggффф 2"# ASCII then Unicode
touch "фффggg 1""фффggg 2"# Unicode then ASCII
touch "один файл"# This one works correctly
Run the script
(Optionally) enter the directory (works either way, just prepend example/ in examples below)
Try performing following autocompletes:
ls один<Tab># this one works
ls При<Tab>
ls Пример<Tab>
ls 例<Tab>
ls g<Tab># this one works
ls ggg<Tab># this also works
ls gggф<Tab>
ls gggффф<Tab>
ls ф<Tab>
ls фффg<Tab># this one works (curiously)
Describe the bug
When we have multiple files whose names
It is possible to cause a panic when autocompleting the file name
A very practical example - when having two files called
Лекція 1.docx
andЛекція 2.docx
in the same directory, trying any of the following autocompletes causes a panic:ls Л<Tab>
ls Ле<Tab>
...ls Лекція<Tab>
(using
ls
is purely demonstrative, autocompleting in any context causes a panic)Curiously enough, the panic happens only when the last character of user's prefix is non-ASCII - for two files
ТестTest 1
andТестTest 2
, autocompletingls Те<Tab>
panics, butls ТестTes<Tab>
does notThis does not happen if you autocomplete with quotes:
ls "Лекц<Tab>"
does not cause a panicThe text of the panic itself (after attempting
ls При<Tab>
) (also occasionally the panic is only seen for a second and then disappears, can't pinpoint why):How to reproduce
Here is a script generating useful examples
example/
in examples below)Expected behavior
No panic
Configuration
The text was updated successfully, but these errors were encountered: