aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.h
diff options
context:
space:
mode:
authorGravatar Jan Kanis <jan.code@jankanis.nl>2013-01-20 22:23:27 +0100
committerGravatar Jan Kanis <jan.code@jankanis.nl>2013-01-20 23:38:21 +0100
commitabae08a9fb596402eca1b36da722cbd384bb09f5 (patch)
tree215080cf32f0ba86ce56b03b767aaa1258c4819a /reader.h
parenta0edee51faabb95b5a3cede66c96b971bdf1e770 (diff)
create reader_data_t.interruptible flag and infrastructure to make it work.
Diffstat (limited to 'reader.h')
-rw-r--r--reader.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/reader.h b/reader.h
index ba024e86..f94d8a89 100644
--- a/reader.h
+++ b/reader.h
@@ -112,8 +112,17 @@ void reader_set_buffer(const wcstring &b, size_t p);
size_t reader_get_cursor_pos();
/**
+ Clear the interrupted flag unconditionally without handling anything. The
+ flag could have been set e.g. when an interrupt arrived just as we were
+ ending an earlier \c reader_readline invocation but before the
+ \c is_interactive_read flag was cleared.
+*/
+void reader_reset_interrupted();
+
+/**
Return the value of the interrupted flag, which is set by the sigint
- handler, and clear it if it was set.
+ handler, and clear it if it was set. If the current reader is interruptible,
+ call \c reader_exit().
*/
int reader_interrupted();
@@ -181,6 +190,9 @@ void reader_set_right_prompt(const wcstring &prompt);
/** Sets whether autosuggesting is allowed. */
void reader_set_allow_autosuggesting(bool flag);
+/** Sets whether the reader should exit on ^C. */
+void reader_set_interruptible(bool flag);
+
/**
Returns true if the shell is exiting, 0 otherwise.
*/