Fix display bug in `less raw`

This commit is contained in:
nervuri 2021-12-25 18:34:53 +00:00
parent 71ff278c59
commit 07291e828a
1 changed files with 7 additions and 3 deletions

10
av98.py
View File

@ -1453,11 +1453,15 @@ Use 'ls -l' to see URLs."""
def do_less(self, *args):
"""Run most recently visited item through "less" command.
'less raw' displays the raw version of the item."""
tmp_file = self.tmp_filename if args[0] == 'raw'\
else self._get_active_tmpfile()
if args[0] == 'raw':
tmp_file = self.tmp_filename
less_opt = '-R'
else:
tmp_file = self._get_active_tmpfile()
less_opt = '-r'
cmd_str = self._get_handler_cmd(self.mime)
cmd_str = cmd_str % tmp_file
subprocess.call("%s | less -r" % cmd_str, shell=True)
subprocess.call("%s | less %s" % (cmd_str, less_opt), shell=True)
@needs_gi
def do_fragment(self, *args):