From a694cfb7bd6fadc9b0c385551c0255ec5c0da068 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 13 Feb 2024 11:09:12 -0800 Subject: [PATCH] Fix "Failed tcsetattr(TCSADRAIN)" when `nix repl` is not a TTY 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" ``` --- src/libcmd/repl.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 26b032693..a7cd15efe 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -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();