Skip to content

Support remote IRB #672

Open
Open

Description

@st0012

(originally proposed by @zzak)

Description

Currently IRB can't be used without direct access to standard IO. This makes it hard to use with tools like foreman.

If we expect IRB to become a more powerful debugging tool, especially after #575 and similar enhancements, the need to connect to it remotely will only grow.

Implementation

  1. Centralise IRB's IO interaction (Avoid using arbitrary puts to print output #580)
  2. Enhance the IO layer with remote connecting medium options (TCP/IP, Socket...etc.)
  3. TBD

Activity

  1. added
    enhancement
    on Aug 7, 2023
  2. IslamElsayed commented on Nov 24, 2026

    @IslamElsayed

    Hi @st0012 @tompng, I'd like to work on this if it's still wanted.

    ruby/debug can't help here today (its remote console prints "IRB is not supported on the remote console."), so binding.irb under foreman, bin/dev or a container still has no way in.

    Following the plan above, I'd do it as two PRs:

    1. Avoid using arbitrary puts to print output #580: send IRB's output through the context's IO instead of Kernel#puts/STDOUT, along the lines of the 2023 comment there (input methods get puts/print). Avoid using arbitrary puts to print output #1025 started this but conflicts with master and hasn't moved since January 2025; I'd build on it and credit @QWYNG, unless they'd rather pick it back up.
    2. A transport: binding.irb waits on a socket when asked to (an option or env var), and irb --attach connects to it.

    Three questions before I start:

    1. UNIX socket only for the first version? A TCP listener is unauthenticated code execution, so I'd leave it out or put it behind an explicit opt-in.
    2. Where should line editing live? I'd keep Reline in the client and send whole lines, like rdbg --attach. That means completion and the doc dialog need a round trip, or stay off in v1. Which would you prefer?
    3. Is building on Avoid using arbitrary puts to print output #1025 fine, or would you rather it be a fresh PR?

    (AI-assisted: prepared with Claude, reviewed by me.)

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions