Skip to content

[Bug]: iOS terminal keeps the keyboard-sized viewport after the keyboard closes #40030

Open

Description

@MegaWattCZE

Written by Claude Code, an AI agent.

Summary

On iPhone 17 Pro, the native iOS terminal keeps its keyboard-sized viewport after the keyboard closes. Swipe scrolling then moves the content only in the upper part of the screen, the part the keyboard did not cover. The lower part stays empty. Query replies (OSC 11 background colour, cursor position report) also show up as typed text at the shell prompt after the querying program ended.

Area

apps/mobile (iOS terminal)

Actual behavior

  1. With the keyboard open, the terminal fills the space above the keyboard toolbar (expected).
  2. After the user closes the keyboard, the terminal output still ends at the old keyboard edge. The area below it stays blank.
  3. A swipe scrolls the output only inside the old, smaller area.
  4. After gh api ... failed, the prompt line contains 11;rgb:0a0a/0a0a/0a0a;1R11;rgb:0a0a/0a0a/0a0a;1R, and the output above it shows ^[]11;rgb:0a0a/0a0a/0a0a^[\^[[14;1R. These are the terminal's replies to an OSC 11 query and a CSI 6 n cursor position query, written to the PTY a second time or after the program stopped reading.

Screenshots: see the comment below (keyboard open, keyboard closed, after a later command).

Steps to reproduce

  1. Open a terminal in the T3 Code iOS app on iPhone 17 Pro (connected to a Linux host, server t3 v0.1.10).
  2. Run a command that queries the terminal, for example any gh command (termenv queries OSC 11 and the cursor position).
  3. Close the keyboard with the toolbar's keyboard button.
  4. Swipe to scroll the terminal output.

Expected behavior

  • After the keyboard closes, the terminal resizes to the full height and scrolling uses the whole area.
  • A terminal query gets one reply, sent once. No reply reaches the shell as input after the program ended.

Additional context

Activity

  1. MegaWattCZE commented on Nov 21, 2026

    @MegaWattCZE
    Author

    image

  2. shivamhwp commented on Nov 21, 2026

    @shivamhwp
    Collaborator

    [Haiku 5.5][Claude Code] on behalf of shivam.

    Thanks for the report and screenshots. We tried to reproduce the viewport part on an iOS simulator at c5514042, with the keyboard closed and one swipe after it. With only the simulator attached, the terminal filled the full height and scrolled normally. So the bug seems to need something that the simulator run didn't have. Could you check these, so we can pin it down:

    1. While the terminal showed the short viewport, was the same terminal also open in T3 web or the desktop app, or on another phone or tablet?
    2. Before it happened, did the phone sleep, change networks, or reconnect to the server? Does it still happen after you force-quit and reopen the app?
    3. Which iOS version and T3 Code app build were you on? The issue doesn't record them.
    4. Does the terminal reply text (11;rgb…1R) still appear when no other client is attached?

    Please reply here with what you see. We'll pick it back up from there.

  3. gemron commented on Nov 30, 2026

    @gemron

    One way to separate the two symptoms: on a physical iPhone, record the native view height, Ghostty rows/cols, and each PTY resize request while dismissing the keyboard. Run it once with only the phone attached and again with the same terminal open on desktop. Start with plain numbered output so the test does not send any terminal queries.

    If the view grows but the row count stays at the keyboard-open value, the resize is getting lost between layout and the grid. If the row count grows and then flips back only with the desktop attached, check which client sent that last resize. As a separate assertion, the same surface should grow without replaying retained output, as in #36115 for config changes.

    I maintain Termexo. In our browser-based terminal, excluding height-only keyboard changes from the replay path fixed a similar redraw symptom. The native iOS debug trace above would help establish whether the viewport issue here has the same cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions