iterm patch

This commit is contained in:
Will McGugan
2024-11-12 15:24:46 +00:00
parent 436123a005
commit a5a6edca82

View File

@@ -1,5 +1,6 @@
from __future__ import annotations
import os
import re
from typing import Any, Generator, Iterable
@@ -42,6 +43,9 @@ _re_in_band_window_resize: Final = re.compile(
)
IS_ITERM = os.environ.get("TERM_PROGRAM", "") == "iTerm.app"
class XTermParser(Parser[Message]):
_re_sgr_mouse = re.compile(r"\x1b\[<(\d+);(\d+);(\d+)([Mm])")
@@ -262,7 +266,8 @@ class XTermParser(Parser[Message]):
setting_parameter = int(mode_report_match["setting_parameter"])
if mode_id == "2026" and setting_parameter > 0:
on_token(messages.TerminalSupportsSynchronizedOutput())
elif mode_id == "2048":
elif mode_id == "2048" and not IS_ITERM:
# TODO: remove "and not IS_ITERM" when https://gitlab.com/gnachman/iterm2/-/issues/11961 is fixed
in_band_event = messages.TerminalSupportInBandWindowResize.from_setting_parameter(
setting_parameter
)