MCPcopy Create free account
hub / github.com/ipython/ipython / get_pager_cmd

Function get_pager_cmd

IPython/core/page.py:283–302  ·  view source on GitHub ↗

Return a pager command. Makes some attempts at finding an OS-correct one.

(pager_cmd=None)

Source from the content-addressed store, hash-verified

281
282
283def get_pager_cmd(pager_cmd=None):
284 """Return a pager command.
285
286 Makes some attempts at finding an OS-correct one.
287 """
288 if os.name == 'posix':
289 default_pager_cmd = 'less -R' # -R for color control sequences
290 elif os.name in ['nt','dos']:
291 default_pager_cmd = 'type'
292
293 if pager_cmd is None:
294 try:
295 pager_cmd = os.environ['PAGER']
296 except:
297 pager_cmd = default_pager_cmd
298
299 if pager_cmd == 'less' and '-r' not in os.environ.get('LESS', '').lower():
300 pager_cmd += ' -R'
301
302 return pager_cmd
303
304
305def get_pager_start(pager, start):

Callers 2

pager_pageFunction · 0.85
page_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected