Skip to content

nushell shouldn't do anything job control-y when not in interactive mode #9026

Description

@yshui

Describe the bug

Even when nushell is started in non-interactive mode (i.e. nu -c command), it still does job control stuff (e.g. blocking SIGTSTP, set tty foreground process group, etc.).

Most shells (e.g. bash, zsh, dash) will disable job control when not in interactive mode, unless explicitly turned on by options. nushell should do this same.

How to reproduce

  1. nu -c command

Expected behavior

nu doesn't block TSTP, and doesn't create new process groups.

Screenshots

No response

Configuration

key value
version 0.78.0
branch makepkg
commit_hash 2ec2028
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.68.2 (9eb3afe9e 2023-03-27) (Arch Linux rust 1:1.68.2-1)
cargo_version cargo 1.68.2
build_time 2023-04-05 02:09:35 +00:00
build_rust_channel release
features default, zip
installed_plugins

Additional context

No response

Activity

  1. yshui commented on Apr 28, 2023

    @yshui
    Author

    as a more concrete example, the expected result of pressing Ctrl-Z while running nu -c nvim, is nu being suspended along with nvim.

  2. added
    status:needs-core-team-attention
    status:needs-triage
    on Apr 28, 2023
  3. amtoine commented on Apr 28, 2023

    @amtoine
    Member

    as a more concrete example, the expected result of pressing Ctrl-Z while running nu -c nvim, is nu being suspended along with nvim.

    how would you un-suspend nvim and nu after pressing <C-z>?

    i'm not sure i see the use case of this, not super familiar with SIG control signals 😋

  4. yshui commented on Apr 28, 2023

    @yshui
    Author

    so if I run nu in non-interactive mode, job control would be the responsibility of whatever I ran nu from. If I ran nu -c nvim from an interactive nushell instance, then it will inherit the blocked signals and I won't be able to suspend it anyway. If I ran nu -c nvim from a zsh instance, then I will be able to un-suspend it by running fg in zsh.

  5. added
    A:signal-cancel
    on Apr 29, 2023
  6. IanManske commented on Jul 17, 2023

    @IanManske
    Member

    @fdncred I think this should still be open. Although #9693 fixes nushell setting the foreground process group, it doesn't fix anything regarding signals.

  7. added a commit that references this issue on Jan 15, 2024
    9249865
  8. added this to the v0.90.0 milestone on Jan 15, 2024
  9. added a commit that references this issue on Feb 20, 2024
    6fa6b87
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

    A:signal-cancelstatus:needs-core-team-attentionstatus:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions