From f0b7204af0112436952963bdf3a4145da4570792 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 20 May 2015 18:58:03 -0700 Subject: [PATCH] fix for tmux 2.0. closes #137. --- lib/tput.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/tput.js b/lib/tput.js index c579dec..7d944c1 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -2041,6 +2041,18 @@ Tput.prototype.detectBrokenACS = function(info) { return !!+process.env.NCURSES_NO_UTF8_ACS; } + if (process.env.TMUX != null) { + try { + var tver = cp.execFileSync('tmux', ['-V'], { encoding: 'utf8' }); + tver = +tver.split(' ')[1].split('.')[0]; + } catch (e) { + ; + } + if (tver == null || tver >= 2) { + return true; + } + } + // If the terminal supports unicode, we don't need ACS. if (info.numbers['U8'] >= 0) { return !!info.numbers['U8'];