class IRB::Context

def prompting?

for more information.
StdioInputMethod or RelineInputMethod or ReadlineInputMethod, see #io
Whether #verbose? is +true+, and +input_method+ is either
def prompting?
  verbose? || (STDIN.tty? && @io.kind_of?(StdioInputMethod) ||
               @io.kind_of?(RelineInputMethod) ||
               (defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)))
end