Closed s3i7h closed 2 years ago
A different error when trying to choose from the completion list after typing multibyte letter
[ERROR ] /Users/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.2/src/main.rs: panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', /Users/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.2/src/bash_server.rs:26:33
[ERROR ] /Users/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.2/src/main.rs: panicked at 'assertion failed: self.is_char_boundary(n)', /Users/$USER/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/string.rs:1561:29
[ERROR ] /Users/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.2/src/main.rs: 0: 0x101fabc18 - backtrace::capture::Backtrace::new::hba9adf1e5b3c7a91
1: 0x101f727d8 - nsh::main::{{closure}}::h67739294c6afee12
2: 0x102027e9d - std::panicking::rust_panic_with_hook::hae2b05f08a320721
3: 0x102045c5c - std::panicking::begin_panic_handler::{{closure}}::h72d68d3a77e0b718
4: 0x102045c27 - std::sys_common::backtrace::__rust_end_short_backtrace::h7c5e286792f94edb
5: 0x102045be0 - _rust_begin_unwind
6: 0x10205ed9f - core::panicking::panic_fmt::h1b194bb80d76fb10
7: 0x10205ecf7 - core::panicking::panic::hdb9dddaff64fd68b
8: 0x101f45674 - nsh::mainloop::Mainloop::select_completion::h070c0693897dce31
9: 0x101f3a94a - nsh::mainloop::Mainloop::handle_key_event::h72f2fc3ed6d69a71
10: 0x101f399ae - nsh::mainloop::Mainloop::handle_event::h98f98893dfe246aa
11: 0x101f3602f - nsh::mainloop::Mainloop::run::hd7a071cbdcd9cbdc
12: 0x101f6e6e2 - nsh::shell_main::ha315b12f85f157a9
13: 0x101f71ff9 - nsh::main::h367ea8887b771698
14: 0x101ecb2aa - std::sys_common::backtrace::__rust_begin_short_backtrace::hde4e21082195018a
15: 0x101f88794 - _main
[ERROR ] /Users/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.2/src/main.rs: panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', /Users/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.2/src/bash_server.rs:26:33
Thanks for reporting the issue, @yu-ichiro! As you mentioned it's similar to #14, but I guess it's another wide-width character handling bug.
I was trying out nsh on my macbook and encountered this. (might be related to #14 ?)
I'm in a LANG=ja_JP.UTF-8 environment, and nsh was acting weird in a directory with a name consisting multibyte letters. (The left prompt and the actual input area were separated way apart) The actual crash occurred when trying to type a letter after completing a multibyte directory name.
PoC:
(sidenote:
ぴーおーしー
is "PoC" in Japanese hiragana representation and doesn't mean anything)