nix-shell doesn't send SIGTERM to shellHook upon receiving SIGTERM` #1160

Open
opened 2026-03-18 19:40:15 +00:00 by winter · 0 comments
Member

Describe the bug

Running a nix-shell invocation on a shell that contains a shellHook that reads from stdin:

winter@winter-desktop ~/s/nixpkgs> nix-shell maintainers/scripts/update.nix --argstr package snouty

Going to be running update for following packages:
 - snouty-0.3.1

Press Enter key to continue...^CStill shutting down. Press ^C again to abort all operations immediately.

I had to abort the tasks, or kill the shell hook manually.

Steps To Reproduce

  1. $ nix-shell maintainers/scripts/update.nix --argstr package hello
  2. ctrl-c

Expected behavior

For SIGTERM to propagate to the shellHook, causing it to die gracefully.

nix --version output

nix (Lix, like Nix) 2.94.0
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/winter/.config/nix/nix.conf:/home/winter/.config/kdedefaults/nix/nix.conf:/nix/store/0q6ydqfjgwhlsczwi5jk4ds1dpxdnrns-plasma-workspace-6.6.2/etc/xdg/nix/nix.conf:/nix/store/1r1bfsknakc5kfz0gmf0i3h9jqlqqcnn-kglobalacceld-6.6.2/etc/xdg/nix/nix.conf:/nix/store/qrw4yjb7king22w52ivrjaa5d1vkx9zc-baloo-6.24.0/etc/xdg/nix/nix.conf:/home/winter/.config/kdedefaults/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/winter/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/winter/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/winter/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/x85phs4q3mz781kfra3vb5k1kdrhvyj7-lix-2.94.0/share
## Describe the bug Running a `nix-shell` invocation on a shell that contains a `shellHook` that reads from stdin: ``` winter@winter-desktop ~/s/nixpkgs> nix-shell maintainers/scripts/update.nix --argstr package snouty Going to be running update for following packages: - snouty-0.3.1 Press Enter key to continue...^CStill shutting down. Press ^C again to abort all operations immediately. ``` I had to abort the tasks, or `kill` the shell hook manually. ## Steps To Reproduce 1. `$ nix-shell maintainers/scripts/update.nix --argstr package hello` 2. ctrl-c ## Expected behavior For SIGTERM to propagate to the `shellHook`, causing it to die gracefully. ## `nix --version` output ``` nix (Lix, like Nix) 2.94.0 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/winter/.config/nix/nix.conf:/home/winter/.config/kdedefaults/nix/nix.conf:/nix/store/0q6ydqfjgwhlsczwi5jk4ds1dpxdnrns-plasma-workspace-6.6.2/etc/xdg/nix/nix.conf:/nix/store/1r1bfsknakc5kfz0gmf0i3h9jqlqqcnn-kglobalacceld-6.6.2/etc/xdg/nix/nix.conf:/nix/store/qrw4yjb7king22w52ivrjaa5d1vkx9zc-baloo-6.24.0/etc/xdg/nix/nix.conf:/home/winter/.config/kdedefaults/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/winter/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/winter/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/winter/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/x85phs4q3mz781kfra3vb5k1kdrhvyj7-lix-2.94.0/share ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1160
No description provided.