Project

General

Profile

Actions

Bug #6131

closed

Ctrl-C handler do not work from exec process (Windows)

Added by luislavena (Luis Lavena) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.3-p155 (2012-03-03) [i386-mingw32]
Backport:
[ruby-core:43245]

Description

Hello,

Originally reported to TheCodeShop group: https://groups.google.com/forum/?fromgroups#!topic/thecodeshop/ZI9FY-RKYgs

The usage of "rails server" uses exec to spawn another process to run a server, and that process do not handle Ctrl-C.

Script to recreate this issue:

https://gist.github.com/2009356

=begin a.rb
trap(:INT) do
puts "Hit Ctrl+C in a.rb"
end

exec "ruby b.rb"
=end

=begin b.rb
trap(:INT) do
puts "Hit Ctrl+C in b.rb"
exit(false)
end

sleep
=end

Invoking b directly from command line works, but from a.rb it fails to respond to Ctrl-C


Files

process.patch (9.09 KB) process.patch h.shirosaki (Hiroshi Shirosaki), 04/03/2012 10:44 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #1952: cannot stop with Ctrl+CClosedko1 (Koichi Sasada)08/18/2009Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0