From 50e3c8f55148ed842acf8f583f198c1b174e47fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Mon, 27 Jul 2009 12:02:52 +0200 Subject: [PATCH] Avoid initializing readline if not writing to terminal. --- src/utils/misc.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/misc.cc b/src/utils/misc.cc index 618dcd0..6fe4ce9 100644 --- a/src/utils/misc.cc +++ b/src/utils/misc.cc @@ -61,6 +61,9 @@ string readline_getline() unsigned get_screen_width() { + if (!::isatty(STDOUT_FILENO)) + return 80; + int width = 80; const char *cols_env = getenv("COLUMNS"); -- 2.7.4