Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Jobs
- MANAGER = new
- def self.manager
- MANAGER
- end
- def initialize(@fg : Process? = nil)
- end
- property fg
- end
- Signal::INT.trap do |x|
- if !Jobs.manager.fg
- puts "Got SIGINT, but there is no process in the foreground."
- else
- Jobs.manager.fg.kill(Signal::INT)
- end
- end
- Gives the following error:
- Error in src/crysh.cr:27: undefined method 'kill' for Nil (compile-time type is (Process | Nil))
- Jobs.manager.fg.kill(Signal::INT)
- ^~~~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement