add the longer prompt in less to see position

This commit is contained in:
Lionel Dricot 2022-01-06 13:44:02 +01:00
parent c9ec5eb243
commit 2f78452f9c
2 changed files with 7 additions and 3 deletions

View File

@ -42,7 +42,7 @@ Known issues in the code:
* FIXME2: offline web browser use os.system because its the only one that understands the ">> file.txt"
* TODO: Update blackbox to reflect cache hits.
* TODO: allow to search cache while offline
## More

View File

@ -68,6 +68,8 @@ _MAX_CACHE_SIZE = 10
_MAX_CACHE_AGE_SECS = 180
# TODO :use XDG spec for cache
_CACHE_PATH = "~/.cache/offpunk/"
#_DEFAULT_LESS = "less -EXFRfM -PMurl\ lines\ \%lt-\%lb/\%L\ \%Pb\%$ %s"
_DEFAULT_LESS = "less -EXFRfM %s"
# Command abbreviations
_ABBREVS = {
@ -103,7 +105,6 @@ _MIME_HANDLERS = {
"audio/ogg": "ogg123 %s",
"image/*": "feh %s",
"text/html": "lynx -dump -force_html %s",
"text/*": "less -EFXRf %s",
}
@ -1051,8 +1052,11 @@ you'll be able to transparently follow links to Gopherspace!""")
if fnmatch.fnmatch(mimetype, handled_mime):
break
else:
if mimetype.startswith("text/"):
cmd_str = _DEFAULT_LESS
else:
# Use "xdg-open" as a last resort.
cmd_str = "xdg-open %s"
cmd_str = "xdg-open %s"
self._debug("Using handler: %s" % cmd_str)
return cmd_str