Skip to content

kill -0 behaves oddly #18080

Closed
Closed

Description

@quintuple-mallard

Bug report form

  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.

Describe the bug

When the command kill -0 is run, the nu process ($nu.pid) is terminated by a SIGTERM (15).

How to reproduce

Run kill -0 in nushell.

Expected behavior

I expected kill -0 to be equivalent to kill -s 0.

I expect kill -s 0 to either error, or not send any signal as in bash.

Configuration

key value
version 0.112.2
major 0
minor 112
patch 2
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.94.1 (e408947bf 2026-03-25) (Homebrew)
cargo_version cargo 1.94.1 (Homebrew)
build_time 2026-04-15 12:50:12 +00:00
build_rust_channel release
allocator standard
features default, mcp, network, plugin, rustls-tls, sqlite, trash-support
installed_plugins
experimental_options example=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=false, native-clip=false, cell-path-types=false

Activity

  1. added
    status:needs-triage
    on Apr 21, 2026
  2. changed the title [-]`kill -0` kills the nu process[/-] [+]`kill -0` behaves oddly[/+] on Apr 21, 2026
  3. fdncred commented on Apr 21, 2026

    @fdncred
    Contributor

    What's happening is it's seeing -0 as pid 0 not a signal and killing it. I'm not completely sure if nushell can catch this since - is reserved for short parameters and flags.

  4. quintuple-mallard commented on Apr 21, 2026

    @quintuple-mallard
    Author

    Ah, I see. Hadn't realized -0 would be parsed as a number literal.

  5. Juhan280 commented on Apr 21, 2026

    @Juhan280
    Contributor

    kill -0 is equivalent to kill 0. Nushell doesn't use kill -SIG syntax. You must specify the -s flag.

    Edit: The fact that nushell implicitly converts kill -9 into kill -s 9 seems like a bug to me. There is no where in the documentation that talks about this.

  6. added a commit that references this issue on May 4, 2026
    b9d3a27
  7. added this to the v0.113.0 milestone on May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions