...
This commit is contained in:
+1
-1
@@ -1346,7 +1346,7 @@ class Boss:
|
||||
# the system less before macOS 12.3 barfs up OSC codes, so sanitize them ourselves
|
||||
sentinel = os.path.join(cache_dir(), 'less-is-new-enough')
|
||||
if not os.path.exists(sentinel):
|
||||
if less_version() >= 581:
|
||||
if less_version(cmd[0]) >= 581:
|
||||
open(sentinel, 'w').close()
|
||||
else:
|
||||
bdata = re.sub(br'\x1b\].*?\x1b\\', b'', bdata)
|
||||
|
||||
@@ -41,7 +41,7 @@ class ScrollWindow(RemoteCommand):
|
||||
pages = 'p' in amt
|
||||
unscroll = 'u' in amt
|
||||
mult = -1 if amt.endswith('-') and not unscroll else 1
|
||||
q = int(amt.rstrip('+-pu'))
|
||||
q = int(amt.rstrip('+-plu'))
|
||||
amount = q * mult, 'p' if pages else ('u' if unscroll else 'l')
|
||||
|
||||
return {'match': opts.match, 'amount': amount}
|
||||
|
||||
+1
-1
@@ -953,7 +953,7 @@ def macos_version() -> Tuple[int, ...]:
|
||||
return tuple(map(int, platform.mac_ver()[0].split('.')))
|
||||
|
||||
|
||||
@run_once
|
||||
@lru_cache(maxsize=2)
|
||||
def less_version(less_exe: str = 'less') -> int:
|
||||
import subprocess
|
||||
o = subprocess.check_output([less_exe, '-V'], stderr=subprocess.STDOUT).decode()
|
||||
|
||||
Reference in New Issue
Block a user