mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
iterm patch
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user