Yes, you can in Windows Vista 7 and possibly 8, as well as in some third-party advanced command interpreters, such as 4NT and Take Command, you can recall previous commands using the up key, execute the line. I don't understand what Ruby has to do with this. If you want to allow Ruby-type keystrokes in the console, which is possible using Active-X automatic control.
EDIT: here's a sample using Autoit to edit the console, downlaod and install it first, and then run the following script. To make sure that the script does not interact with other open consoles, I copied mu cmd.exe to cmd2.exe, which starts first.
require 'win32ole' title = "C:\\Windows\\System32\\cmd2.exe" STDOUT.sync = true ai = WIN32OLE.new("AutoItX3.Control") ai.winwait(title) ai.WinActivate(title, "") ai.Send "cls{ENTER}" 1.upto(4) do |i| ai.Send "line#{i}{ENTER}" end 1.upto(4) do |i| ai.Send "{UP}" sleep 1 end ai.Send "line one {ENTER}"
peter source share