From 1c860cc7c0b27bf93f169ca81ae476a818903a6c Mon Sep 17 00:00:00 2001 From: desaintmartin Date: Fri, 31 May 2013 10:33:12 +0000 Subject: Fixed "which" calls being verbose to stderr. Add "vi" to the list of possible editors. --- cmd2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd2.py b/cmd2.py index 993af89..0048a10 100755 --- a/cmd2.py +++ b/cmd2.py @@ -420,8 +420,8 @@ class Cmd(cmd.Cmd): if sys.platform[:3] == 'win': editor = 'notepad' else: - for editor in ['gedit', 'kate', 'vim', 'emacs', 'nano', 'pico']: - if subprocess.Popen(['which', editor], stdout=subprocess.PIPE).communicate()[0]: + for editor in ['gedit', 'kate', 'vim', 'vi', 'emacs', 'nano', 'pico']: + if subprocess.Popen(['which', editor], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0]: break colorcodes = {'bold':{True:'\x1b[1m',False:'\x1b[22m'}, -- cgit v1.2.1