chiark / gitweb /
Set the LESS environment if the pager is 'less'
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 13 Jul 2009 22:06:07 +0000 (23:06 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 13 Jul 2009 22:06:07 +0000 (23:06 +0100)
This fixes the coloured output if the PAGER environment is set to less
(similar behaviour to Git).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
stgit/config.py

index f205e5bd91888076de234d91a7733491391ebbdd..4a6cb3bbe04708642c6152b8642822c75e48dedd 100644 (file)
@@ -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: