From: Catalin Marinas Date: Mon, 13 Jul 2009 22:06:07 +0000 (+0100) Subject: Set the LESS environment if the pager is 'less' X-Git-Tag: v0.15-rc2~22 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/e6bca570feaf606dc80a53c9932ec4dca1076784 Set the LESS environment if the pager is 'less' This fixes the coloured output if the PAGER environment is set to less (similar behaviour to Git). Signed-off-by: Catalin Marinas --- diff --git a/stgit/config.py b/stgit/config.py index f205e5b..4a6cb3b 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -37,7 +37,7 @@ class GitConfig: 'stgit.keepoptimized': 'no', 'stgit.extensions': '.ancestor .current .patched', 'stgit.shortnr': '5', - 'stgit.pager': 'less -FRSX' + 'stgit.pager': 'less' } __cache = None @@ -121,6 +121,7 @@ def config_setup(): global config os.environ.setdefault('PAGER', config.get('stgit.pager')) + os.environ.setdefault('LESS', '-FRSX') # FIXME: handle EDITOR the same way ? class ConfigOption: