Closed codeferret1 closed 13 years ago
Seems that the root of the issue is key = instance_eval(key)
Wonder why key is been install evaled.
Asking Park (the author) right now.
Yes, now that you mention it this does allow me to run arbitrary ruby code from my .inputrc:
"C-u": possible-completions
puts "hi"
system("rm my_important_file.txt")
# END FILE
$ touch my_imporant_file.txt
$ irb
"hi" is printed
$ ctrl-D
$ ls | grep important
$
... Is that working as intended?
No, inputrc should not be processed like active code
Do not eval inputrc defitions. Closed by 28d987edc2fe8cc2684fa3e1bf612374b090d079
In my .inputrc the following line:
causes: C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:2398:in
instance_eval': uninitialized constant Module::C (NameError) from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:2398:in
instance_eval'For the unsurprising reason that it is trying to evaluate the C as-is, not as a string.
Changing the line to: "C-u": possible-completions
Fixes the error.
I was rather slow at finding the cause of this (http://groups.google.com/group/rubyinstaller/browse_thread/thread/fb14c5a950e335e4#).
It may be helpful to have a more to-the-point error message (or just handle unquoted key-combos).
-------------- Environment Ruby version: 1.8.7 Installed on windows via 1.8.7p302 RubyInstaller from rubyinstaller.org Windows 7
Steps to repro:
BEGIN FILE
C-u: possible-completions
END FILE