Skip to content

Commit

Permalink
Enable only interrupt bits on intr: true
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 29, 2019
1 parent bc9ae9e commit baaf929
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/io/console/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ set_rawmode(conmode *t, void *arg)
#endif
#ifdef ISIG
if (r->intr) {
t->c_iflag |= BRKINT|IXON;
t->c_iflag |= BRKINT;
t->c_lflag |= ISIG;
}
#endif
Expand Down
5 changes: 5 additions & 0 deletions test/io/console/test_io_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ def test_intr
assert_ctrl("#{cc.ord}", cc, r, w)
assert_ctrl("#{cc.ord}", cc, r, w)
end
if cc = ctrl["stop"]
assert_ctrl("#{cc.ord}", cc, r, w)
assert_ctrl("#{cc.ord}", cc, r, w)
assert_ctrl("#{cc.ord}", cc, r, w)
end
end
end

Expand Down

0 comments on commit baaf929

Please sign in to comment.