Skip to content

Commit

Permalink
Enable string/stmt completion and method definition prompts. Remove p…
Browse files Browse the repository at this point in the history
…otentially long context name from prompts.
  • Loading branch information
Jennifer Hickey committed Feb 1, 2012
1 parent 3804ecd commit 967de60
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/live_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,16 @@ def IRB.start_with_io(io, bind, &block)
end

ws = IRB::WorkSpace.new(bind)
#This needs to be before Irb.new so we get a prompt the first time
@CONF[:PROMPT_MODE] = :INF_RUBY

@CONF[:PROMPT_MODE] = :DEFAULT
#Remove the context from all prompts-can be too long depending on binding
@CONF[:PROMPT][:DEFAULT][:PROMPT_I] = "%N():%03n:%i> "
@CONF[:PROMPT][:DEFAULT][:PROMPT_N] = "%N():%03n:%i> "
#Add > to S and C as they don't get picked up by telnet prompt scan
@CONF[:PROMPT][:DEFAULT][:PROMPT_S] = "%N():%03n:%i%l> "
@CONF[:PROMPT][:DEFAULT][:PROMPT_C] = "%N():%03n:%i*> "

@CONF[:USE_READLINE] = false
irb = Irb.new(ws, io, io)
bind ||= IRB::Frame.top(1) rescue TOPLEVEL_BINDING

Expand Down

0 comments on commit 967de60

Please sign in to comment.