From e6bca570feaf606dc80a53c9932ec4dca1076784 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Mon, 13 Jul 2009 23:06:07 +0100 Subject: [PATCH] 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 --- stgit/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.11.0