Merge pull request #570 from joeythesaint/jjm/rtv-pager
pager: Add RTV_PAGER to support a reddit-specific setting
This commit is contained in:
@@ -127,6 +127,7 @@ def main():
|
||||
('$RTV_URLVIEWER', os.getenv('RTV_URLVIEWER')),
|
||||
('$RTV_BROWSER', RTV_BROWSER),
|
||||
('$BROWSER', BROWSER),
|
||||
('$RTV_PAGER', os.getenv('RTV_PAGER')),
|
||||
('$PAGER', os.getenv('PAGER')),
|
||||
('$VISUAL', os.getenv('VISUAL')),
|
||||
('$EDITOR', os.getenv('EDITOR'))]
|
||||
|
||||
@@ -560,12 +560,17 @@ class Terminal(object):
|
||||
|
||||
def open_pager(self, data, wrap=None):
|
||||
"""
|
||||
View a long block of text using the system's default pager.
|
||||
View a long block of text using an external pager / viewer. The setting
|
||||
of the RTV_PAGER variable will be used if set, otherwise the system's
|
||||
default pager is chosen, finally defaulting to 'less' if both RTV_PAGER
|
||||
and PAGER is unset in the calling environment.
|
||||
|
||||
The data string will be piped directly to the pager.
|
||||
"""
|
||||
|
||||
pager = os.getenv('PAGER') or 'less'
|
||||
pager = os.getenv('RTV_PAGER')
|
||||
if pager is None:
|
||||
pager = os.getenv('PAGER') or 'less'
|
||||
command = shlex.split(pager)
|
||||
|
||||
if wrap:
|
||||
|
||||
Reference in New Issue
Block a user