Skip to content

Commit

Permalink
Merge branch 'iterm-fix' into content
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 12, 2024
2 parents bfe0694 + a5a6edc commit 99d1ab9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/textual/_xterm_parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
import re
from typing import Any, Generator, Iterable

Expand Down Expand Up @@ -42,6 +43,9 @@
)


IS_ITERM = os.environ.get("TERM_PROGRAM", "") == "iTerm.app"


class XTermParser(Parser[Message]):
_re_sgr_mouse = re.compile(r"\x1b\[<(\d+);(\d+);(\d+)([Mm])")

Expand Down Expand Up @@ -262,7 +266,8 @@ def send_escape() -> None:
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
)
Expand Down

0 comments on commit 99d1ab9

Please sign in to comment.