Skip to content

nix repl :p is not interruptible #13481

@tejing1

Description

@tejing1

Describe the bug

The lazy evaluation and traversal of a large datastructure through the repl's :p command cannot be interrupted via ctrl-c.

Steps To Reproduce

  • nix-repl> pkgs = import <nixpkgs> {}
    nix-repl> :p pkgs
    
  • Try to stop it with ctrl-c
  • Be ready to send a TERM signal from another terminal or wait... quite a while.

Expected behavior

Ctrl-c should stop the current evaluation and return to the repl prompt in a timely manner.

Metadata

$ nix-env --version
nix-env (Nix) 2.28.3

Additional context

I'm writing some flake-parts modules that handle and name nixpkgs instantiations for memoization purposes... I triggered this quite a few times in debugging even after I already knew not to in theory.

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglanguageThe Nix expression language; parser, interpreter, primops, evaluation, etcreplThe Read Eval Print Loop, "nix repl" command and debugger

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions