| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d4db7ed commit ee91bf1
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,6 +34,7 @@ | |||
| 34 | 34 | from bpython import translations; translations.init() | |
| 35 | 35 | from bpython.translations import _ | |
| 36 | 36 | from bpython._py3compat import py3 | |
| 37 | + from bpython.pager import get_pager_command | ||
| 37 | 38 | ||
| 38 | 39 | from bpython.curtsiesfrontend import replpainter as paint | |
| 39 | 40 | from bpython.curtsiesfrontend import sitefix; sitefix.monkeypatch_quit() | |
@@ -1350,7 +1351,7 @@ def focus_on_subprocess(self, args): | |||
| 1350 | 1351 | signal.signal(signal.SIGWINCH, prev_sigwinch_handler) | |
| 1351 | 1352 | ||
| 1352 | 1353 | def pager(self, text): | |
| 1353 | - command = os.environ.get('PAGER', 'less -rf').split() | ||
| 1354 | + command = get_pager_command() | ||
| 1354 | 1355 | with tempfile.NamedTemporaryFile() as tmp: | |
| 1355 | 1356 | tmp.write(text) | |
| 1356 | 1357 | tmp.flush() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,10 +27,10 @@ | |||
| 27 | 27 | import pydoc | |
| 28 | 28 | import subprocess | |
| 29 | 29 | import sys | |
| 30 | + import shlex | ||
| 30 | 31 | ||
| 31 | - | ||
| 32 | - def get_pager_command(): | ||
| 33 | - command = os.environ.get('PAGER', 'less -r').split() | ||
| 32 | + def get_pager_command(default='less -r'): | ||
| 33 | + command = shlex.split(os.environ.get('PAGER', default)) | ||
| 34 | 34 | return command | |
| 35 | 35 | ||
| 36 | 36 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments