Sometimes things are missing from my irb history. This has been happening for years and I haven't really noticed a 开发者_JAVA百科pattern. I'll use irb for a while, control-d out of it, come back in a few minutes later, and the commands I was just using aren't there, but commands from earlier in the day or week are there. This is mostly/always in a rails console.
Here's my .irbrc
I could be wrong, but reading over http://trac.greenstone.org/browser/extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/irb/ext/save-history.rb?rev=18425 makes me think that the last irb process will overwrite the other processes history with its own.
So if you run:
irb
irb #in another term window
"a string" #then Ctrl-D in the first
#Ctrl-D in the second
then your .irb-history should be unchanged, as the initial, backgrounded irb will have loaded the old history, then overwritten the new history as it exits.
ie: Somewhat foolishly: open('w') rather than open('a') is the culprit.
You might consider writing a patch and commiting it for the greater good if this strongly irritates you.
精彩评论