我有以下代码
class TimeReport
def run
init_screen
lines = Curses::lines
cols = Curses::cols
read=""
begin
crmode
noecho
gotoDay diaActual.data.to_s #loads the screen with data
while !read.eql?("q")
printPrompt #simply prints the command prompt
read=STDIN.getc
printOnSpot 10,10,read.to_s #prints what was read
if(!read.empty? && !read.strip.empty?)
processPrompt(read,@ecra) # process the read command
else
printInfo "Say What??"
end
end
ensure
echo
nocrmode
close_screen
end
end
end
TimeReport.new.run
当我尝试运行应用程序时,应用程序会锁定并且不会初始化屏幕。如果我使用 Curses.getch,则不会出现此问题。
谁能告诉我为什么会发生这种情况?以及解决问题的方法?