From: Joel VanderWerf Date: 2008-10-29T05:03:58+09:00 Subject: Re: irb: Is it possible to automatically create a subsession on startup? William Fisk wrote: > yes I am using .irbrc, but it doesn't work when you pur > 'irb $psauto' in it. At least it doesn't work for me Try this in .irbrc: module IRB def IRB.start_session(*args) unless $irb IRB.setup nil end workspace = WorkSpace.new(*args) if @CONF[:SCRIPT] ## normally, set by parse_opts $irb = Irb.new(workspace, @CONF[:SCRIPT]) else $irb = Irb.new(workspace) end @CONF[:IRB_RC].call($irb.context) if @CONF[:IRB_RC] @CONF[:MAIN_CONTEXT] = $irb.context trap 'INT' do $irb.signal_handle end custom_configuration if defined?(IRB.custom_configuration) catch :IRB_EXIT do $irb.eval_input end end end x = Object.new puts "\nStarted irb shell for x" IRB.start_session(x) -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407