-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Describe the bug
When you tab-complete some variables containing errors in nix-repl, the repl crashes. Happens with builtins.fromJSON, but possibly otherwise too.
Steps To Reproduce
[user@nixos:~]$ nix repl
nix-repl> err1 = builtins.fromJSON "nixnix"
nix-repl> err1.<TAB>
error:
… while calling the 'fromJSON' builtin
at «string»:1:2:
1| builtins.fromJSON "nixnix"
| ^
… while decoding a JSON string
error: [json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid literal; last read: 'ni'
[user@nixos:~]$the text input in the resulting shell is invisible too.
Expected behavior
handling the Error internally without crashing nix repl
[user@nixos:~]$ nix repl
nix-repl> err1 = builtins.fromJSON "nixnix"
nix-repl> err1.<TAB>
error:
… while calling the 'fromJSON' builtin
at «string»:1:2:
1| builtins.fromJSON "nixnix"
| ^
… while decoding a JSON string
error: [json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid literal; last read: 'ni'
nix-repl> err1.Metadata
nix-env (Nix) 2.31.3
Additional context
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.
Reactions are currently unavailable