From 8b099812eab7ccad9ebc6906450b637044de9369 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 15 Jun 2020 18:18:02 +0200 Subject: [PATCH] Respect terminal width printing error messages --- src/libutil/error.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/error.cc b/src/libutil/error.cc index da11d1ffd..0fad9ae42 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -105,7 +105,7 @@ void printCodeLines(std::ostream &out, const string &prefix, const NixCode &nixC std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo) { - size_t errwidth = 80; + auto errwidth = std::max(getWindowSize().second, 20); string prefix = ""; string levelString;