lib/irb.rb in irb-1.13.0 vs lib/irb.rb in irb-1.13.1

- old
+ new

@@ -309,11 +309,13 @@ # Note that the *current* setting *may not* be changed in the IRB session. # # ### Input Method # # The IRB input method determines how command input is to be read; by default, -# the input method for a session is IRB::RelineInputMethod. +# the input method for a session is IRB::RelineInputMethod. Unless the +# value of the TERM environment variable is 'dumb', in which case the +# most simplistic input method is used. # # You can set the input method by: # # * Adding to the configuration file: # @@ -327,13 +329,14 @@ # # * `--singleline` or `--nomultiline` sets the input method to # IRB::ReadlineInputMethod. # * `--nosingleline` or `--multiline` sets the input method to # IRB::RelineInputMethod. +# * `--nosingleline` together with `--nomultiline` sets the +# input to IRB::StdioInputMethod. # # -# # Method `conf.use_multiline?` and its synonym `conf.use_reline` return: # # * `true` if option `--multiline` was given. # * `false` if option `--nomultiline` was given. # * `nil` if neither was given. @@ -926,12 +929,15 @@ # Returns the current context of this irb session attr_reader :context # The lexer used by this irb session attr_accessor :scanner + attr_reader :from_binding + # Creates a new irb session - def initialize(workspace = nil, input_method = nil) + def initialize(workspace = nil, input_method = nil, from_binding: false) + @from_binding = from_binding @context = Context.new(self, workspace, input_method) @context.workspace.load_helper_methods_to_main @signal_status = :IN_IRB @scanner = RubyLex.new @line_no = 1 @@ -1591,10 +1597,10 @@ IRB::Debug.insert_debug_break debugger_irb.debug_break else # If we're not in a debugger session, create a new IRB instance with the current # workspace - binding_irb = IRB::Irb.new(workspace) + binding_irb = IRB::Irb.new(workspace, from_binding: true) binding_irb.context.irb_path = irb_path binding_irb.run(IRB.conf) binding_irb.debug_break end end