nushell: Crash while typing

Describe the bug panic while typing

To Reproduce Steps to reproduce the behavior:

  1. type alias fg_blue = echo $(ansi -e '34m')
  2. type fg_blue and watch the crash as you type the e

Expected behavior not crash

Screenshots

01/13/2021 09:48:39.976 AM ¯\_(ツ)_/¯ ▶ alias fg_blue = echo $(ansi -e '34m')
01/13/2021 09:48:41.743 AM ¯\_(ツ)_/¯ ▶ fg_bluthread 'main' panicked at 'index out of bounds: the len is 7 but the index is 7', crates\nu-engine\src\shell\painter.rs:49:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

[process exited with code 101]

Configuration (please complete the following information):

Run version | pivot and paste the output to show OS, features, etc.

key value
version 0.25.2
branch main
short_commit d06f457b
commit_hash ‘d06f457b2a7dee3acc71ecd0dc8b6a34afbfc5d8’
commit_date 2021-01-11 22:59:53
build_os windows-x86_64
rust_version rustc 1.49.0 (e1884a8e3 2020-12-29)
rust_channel stable (default)
cargo_version cargo 1.49.0 (d00d64df9 2020-12-05)
pkg_version 0.25.2
build_time 2021-01-12 07:29:22
build_rust_channel release
features clipboard-cli, ctrlc, default, directories, dirs, git, ichwh, ptree, rich-benchmark, rustyline, term, trash, uuid, which, zip

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

I’m having a similar crash which seems related so putting here for now:

To Reproduce

“alias gs = git switch” in config.nu $ gs main;<SPACE><TAB>

thread 'main' panicked at 'slice index starts at 17 but ends at 9', library/core/src/slice/index.rs:92:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace`
key value
version 0.67.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.61.0
cargo_version cargo 1.61.0
pkg_version 0.67.0
build_time 2022-08-18 03:10:01 +00:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

edit: appears to be fixed at a later release

I just posted a PR #2934 that should change how alias gets its coloring. After this lands, can try again to see if it still happens?