Skip to content

Add touch text selection and copy controls to the mobile terminal #1764

Description

@wjin17

Summary

Terminal output rendered by xterm does not expose usable native text selection on mobile. From an iPhone, the terminal behaves more like a streamed visual surface than selectable text, making it difficult to copy authentication URLs, codes, errors, and command output.

Workflow

I was using bb remotely from an iPhone and needed to copy text from a terminal during a Claude Code authentication flow.

Current behavior

  • Dragging over terminal output does not produce usable native Safari selection.
  • URLs in terminal output cannot be reliably opened with a normal tap.
  • There is no touch interaction for selecting a word and adjusting the selected range.
  • There is no mobile-friendly Copy action for the selected terminal text.

Expected

  • A normal tap on a detected URL opens it.
  • A long press selects the touched word.
  • The leading selection grabber appears above the first character boundary.
  • The trailing grabber appears below the final character boundary.
  • Grabber stems align with the complete height of their boundary text rows.
  • Either grabber can cross the other, with their leading/trailing roles and orientations swapping automatically.
  • Dragging either grabber expands or shrinks the selection across wrapped lines.
  • Copy and Add to chat actions remain clear of both grabbers.
  • Tapping elsewhere dismisses the selection.
  • The controls use bb's existing theme and visual language rather than copying iOS styling.

Suggested direction

Map touch coordinates to xterm buffer cells, including viewport and wrapped-line offsets. Keep the selected range in buffer coordinates and render bb-styled grabbers from the corresponding cell geometry. Position the selection action menu against the complete selection-and-grabber bounds so collision handling cannot place it over either control.

AGENT GENERATED: by GPT-5

Activity

  1. added
    mobile
    on Aug 18, 2026
  2. wjin17 commented on Aug 18, 2026

    @wjin17
    ContributorAuthor

    Prototype implementation: wjin17#1

    Maintainers: please review the proposed mobile terminal UI and confirm whether it is aligned for an upstream PR.

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

    mobile

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions