Fix #2699
This commit is contained in:
@@ -445,7 +445,8 @@ Program with which to view scrollback in a new window. The scrollback buffer is
|
||||
passed as STDIN to this program. If you change it, make sure the program you
|
||||
use can handle ANSI escape sequences for colors and text formatting.
|
||||
INPUT_LINE_NUMBER in the command line above will be replaced by an integer
|
||||
representing which line should be at the top of the screen.'''))
|
||||
representing which line should be at the top of the screen. Similarly CURSOR_LINE and CURSOR_COLUMN
|
||||
will be replaced by the current cursor position.'''))
|
||||
|
||||
o('scrollback_pager_history_size', 0, option_type=scrollback_pager_history_size, long_text=_('''
|
||||
Separate scrollback history size, used only for browsing the scrollback buffer (in MB).
|
||||
|
||||
@@ -698,7 +698,14 @@ class Window:
|
||||
def show_scrollback(self) -> None:
|
||||
text = self.as_text(as_ansi=True, add_history=True, add_wrap_markers=True)
|
||||
data = self.pipe_data(text, has_wrap_markers=True)
|
||||
cmd = [x.replace('INPUT_LINE_NUMBER', str(data['input_line_number'])) for x in self.opts.scrollback_pager]
|
||||
|
||||
def prepare_arg(x: str) -> str:
|
||||
x = x.replace('INPUT_LINE_NUMBER', str(data['input_line_number']))
|
||||
x = x.replace('CURSOR_LINE', str(data['cursor_y']))
|
||||
x = x.replace('CURSOR_COLUMN', str(data['cursor_x']))
|
||||
return x
|
||||
|
||||
cmd = list(map(prepare_arg, self.opts.scrollback_pager))
|
||||
if not os.path.isabs(cmd[0]):
|
||||
import shutil
|
||||
exe = shutil.which(cmd[0])
|
||||
|
||||
Reference in New Issue
Block a user