Skip to content

Commit

Permalink
Fix "Failed tcsetattr(TCSADRAIN)" when nix repl is not a TTY
Browse files Browse the repository at this point in the history
Before:
```
$ echo builtins.nixVersion | nix repl
Welcome to Nix 2.18.1. Type :? for help.

Failed tcsetattr(TCSADRAIN): Inappropriate ioctl for device
"2.18.1"

Failed tcsetattr(TCSADRAIN): Inappropriate ioctl for device
```

After:
```
$ echo builtins.nixVersion | nix repl
Nix 2.21.0pre20240131_dirty
Type :? for help.
"2.21.0pre20240131_dirty"
```
  • Loading branch information
9999years committed Feb 13, 2024
1 parent 5b26c66 commit a694cfb
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/libcmd/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ bool NixRepl::getLine(std::string & input, const std::string & prompt)
};

setupSignals();
Finally resetTerminal([&]() { rl_deprep_terminal(); });
char * s = readline(prompt.c_str());
Finally doFree([&]() { free(s); });
restoreSignals();
Expand Down

0 comments on commit a694cfb

Please sign in to comment.