From 6d163377ff9ac91c5b17e230f9f3be154439f580 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 19 Jul 2015 05:20:11 -0700 Subject: [PATCH] improve version check. --- lib/program.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/program.js b/lib/program.js index afefb7d..c80a00d 100644 --- a/lib/program.js +++ b/lib/program.js @@ -95,7 +95,7 @@ function Program(options) { if (!self.tmux) return 2; try { version = cp.execFileSync('tmux', ['-V'], { encoding: 'utf8' }); - return +/([\d.]+)/.exec(version)[1]; + return +/^tmux ([\d.]+)/i.exec(version.trim().split('\n')[0])[1]; } catch (e) { return 2; }