Revert "Add fix for tmux 2.1"

This reverts commit 0dace647f9.
This commit is contained in:
Anthony Sottile
2019-09-28 17:06:18 -07:00
parent deffa9d55e
commit acf71db8ca

View File

@@ -1,5 +1,4 @@
import contextlib import contextlib
import functools
import io import io
import shlex import shlex
import sys import sys
@@ -31,24 +30,10 @@ def test_get_lines(s, lines, nl, mixed):
assert ret == (lines, nl, mixed) assert ret == (lines, nl, mixed)
@functools.lru_cache(maxsize=1)
def _tmux_height_off_by_one():
with Runner(sys.executable, '-c', 'input(">")', height=24) as h:
h.await_text('>')
cmd = ('display', '-t0', '-p', '#{pane_height}')
height = int(h.tmux.execute_command(*cmd))
h.press('Enter')
h.await_exit()
assert height in (23, 24)
return height == 23
class PrintsErrorRunner(Runner): class PrintsErrorRunner(Runner):
def __init__(self, *args, height=24, **kwargs): def __init__(self, *args, **kwargs):
self._screenshots: List[str] = [] self._screenshots: List[str] = []
if _tmux_height_off_by_one(): # pragma: no cover (tmux 2.1) super().__init__(*args, **kwargs)
height += 1
super().__init__(*args, height=height, **kwargs)
def screenshot(self, *args, **kwargs): def screenshot(self, *args, **kwargs):
ret = super().screenshot(*args, **kwargs) ret = super().screenshot(*args, **kwargs)