Project

General

Profile

Actions

Bug #3969

closed

irb causes NameError when trapping SIGWINCH with string

Added by sakuro (Sakuro OZAWA) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin9]
[ruby-core:32855]

Description

=begin
Trapping SIGWINCH with a proc works.

$ irb -f

irb(main):001:0> Signal.trap('SIGWINCH', proc { puts 'hola! from proc' })
=> nil
irb(main):002:0> hola! from proc # changing size of terminal window via GUI
irb(main):002:0> hola! from proc
irb(main):002:0> hola! from proc
irb(main):002:0> hola! from proc
puts

=> nil
irb(main):003:0>

But trapping SIGWINCH with a string (method name) causes error.

$ irb -f

irb(main):001:0> def hola; puts 'hola! from named method'; end
=> nil
irb(main):002:0> Signal.trap('SIGWINCH', 'hola')
=> nil
irb(main):003:0> hola! from named method # changing size of terminal window via GUI
irb(main):003:0> hola! from named method
irb(main):003:0> hola! from named method
irb(main):003:0> hola! from named method
puts
/opt/local/lib/ruby/1.8/irb/input-method.rb:98:in gets': uninitialized constant HISTORY (NameError) from /opt/local/lib/ruby/1.8/irb.rb:140:in eval_input'
from /opt/local/lib/ruby/1.8/irb.rb:271:in signal_status' from /opt/local/lib/ruby/1.8/irb.rb:139:in eval_input'
from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:189:in call' from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:189:in buf_input'
from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:104:in getc' from /opt/local/lib/ruby/1.8/irb/slex.rb:206:in match_io'
from /opt/local/lib/ruby/1.8/irb/slex.rb:76:in match' from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:287:in token'
from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:263:in lex' from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:234:in each_top_level_statement'
from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in loop' from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in each_top_level_statement'
from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in catch' from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in each_top_level_statement'
from /opt/local/lib/ruby/1.8/irb.rb:154:in eval_input' from /opt/local/lib/ruby/1.8/irb.rb:71:in start'
from /opt/local/lib/ruby/1.8/irb.rb:70:in catch' from /opt/local/lib/ruby/1.8/irb.rb:70:in start'
from /opt/local/bin/irb:13
=end

Actions #1

Updated by sakuro (Sakuro OZAWA) over 13 years ago

=begin
Today I tried to reproduce this issue, but had no success.
Please close this.
=end

Actions #2

Updated by naruse (Yui NARUSE) over 13 years ago

  • Status changed from Open to Closed

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0