Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With starship: Terminal crashes when a command waiting for stdin is aborted #5074

Closed
Hofer-Julian opened this issue Apr 3, 2022 · 2 comments · Fixed by starship/starship#3833
Labels
🐛 bug Something isn't working

Comments

@Hofer-Julian
Copy link
Contributor

Hofer-Julian commented Apr 3, 2022

Describe the bug

Opening an issue here, but I am not sure whether nushell or starship needs to be fixed.
With activated starship prompt the terminal crashes when a command waiting for stdin is aborted.

How to reproduce

  1. Enable starship as described here
  2. Run cat (or bat on Windows) with no parameters
  3. Abort by pressing ctrl-c
  4. See the followng error:
error: Found argument '-1' which wasn't expected, or isn't valid in this context

	If you tried to supply `-1` as a value rather than a flag, use `-- -1`

USAGE:
    starship prompt [OPTIONS]

For more information try --help

NOTE:
    passed arguments: ["prompt", "--cmd-duration", "1128", "--status", "-1"]
  1. Press ctrl-d
  2. The terminal crashes

Expected behavior

  1. Enable starship as described here
  2. Run cat (or bat on Windows)
  3. Abort by pressing ctrl-c
  4. An empty prompt appears

Screenshots

No response

Configuration

key value
version 0.60.0
build_os linux-x86_64
rust_version rustc 1.59.0 (9d1b2106e 2022-02-23)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.59.0 (49d8809dc 2022-02-10)
pkg_version 0.60.0
build_time 2022-03-23 08:05:49 +01:00
build_rust_channel release
features dataframe, default, trash, which, zip
installed_plugins

Additional context

I've also reproduced that on Windows

@sholderbach sholderbach added the 🐛 bug Something isn't working label Apr 3, 2022
@fdncred
Copy link
Collaborator

fdncred commented Apr 3, 2022

I just reproduced this in nushell. I think that error message is from starship so I think the problem is there. It appears that starship doesn't like negative return values maybe? I also tested this in the nushell prompt without starship and nushell worked fine.

@Hofer-Julian
Copy link
Contributor Author

I just reproduced this in nushell. I think that error message is from starship so I think the problem is there. It appears that starship doesn't like negative return values maybe? I also tested this in the nushell prompt without starship and nushell worked fine.

Indeed.
See starship/starship#3833

Hofer-Julian added a commit to Hofer-Julian/starship that referenced this issue Apr 3, 2022
davidkna pushed a commit to starship/starship that referenced this issue Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants