MCPcopy Index your code
hub / github.com/ipython/ipython / get_pager_cmd

Function get_pager_cmd

IPython/core/page.py:288–307  ·  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

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

Callers 2

pager_pageFunction · 0.85
page_fileFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…