Skip to content

Commit

Permalink
Honor catch_signals == false for Interrupt signal
Browse files Browse the repository at this point in the history
  • Loading branch information
murarth committed May 26, 2018
1 parent 5798870 commit 4392a25
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ impl<'a, Term: 'a + Terminal> Reader<'a, Term> {
pub fn read_line(&mut self) -> io::Result<ReadResult> {
let mut signals = self.lock.report_signals.union(self.lock.ignore_signals);

// Ctrl-C is always intercepted.
// By default, linefeed handles it by clearing the current input state.
signals.insert(Signal::Interrupt);
if self.lock.catch_signals {
// Ctrl-C is always intercepted (unless we're catching no signals).
// By default, linefeed handles it by clearing the current input state.
signals.insert(Signal::Interrupt);
}

// TODO: Try to hold WriteLock continuously when performing multiple
// write operations in a row. Box<TerminalReader> usage currently makes
Expand Down

0 comments on commit 4392a25

Please sign in to comment.