aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-04-03 08:33:14 +0100
committerRon Yorston <rmy@pobox.com>2023-04-03 08:33:14 +0100
commit64c8f5f3d0bbfcaf3b88aa97a23d90c14326b79e (patch)
tree878917ac4dfd0d271494a1b5436db918b0a0ed88 /include
parent1b2ee3667543b2588446dba6655720eb929bfe03 (diff)
downloadbusybox-w32-64c8f5f3d0bbfcaf3b88aa97a23d90c14326b79e.tar.gz
busybox-w32-64c8f5f3d0bbfcaf3b88aa97a23d90c14326b79e.tar.bz2
busybox-w32-64c8f5f3d0bbfcaf3b88aa97a23d90c14326b79e.zip
ash: add support for INT trap
The trap builtin now handles INT. As before, other signals (from a limited list) are accepted but their traps don't have any effect. There's some variability in how shells handle traps. This patch upholds that proud tradition. Various changes are needed to make this work: - Line editing has a new flag to ignore Ctrl-C. - If INT is being trapped or ignored don't call raise_interrupt(). - A minimal implementation of dotrap() is provided. - Call dotrap() when the read builtin or line input detect Ctrl-C. - Adjust Ctrl-C detection when the INT trap is changed. - Set may_have_traps when an INT trap is set. Costs 368-448 bytes. (GitHub issue #303)
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 4276bae61..2841d7fbf 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -2040,6 +2040,9 @@ enum {
2040 VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI, 2040 VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI,
2041 WITH_PATH_LOOKUP = 0x10, 2041 WITH_PATH_LOOKUP = 0x10,
2042 LI_INTERRUPTIBLE = 0x20, 2042 LI_INTERRUPTIBLE = 0x20,
2043#if ENABLE_PLATFORM_MINGW32
2044 IGNORE_CTRL_C = 0x40,
2045#endif
2043 FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION | LI_INTERRUPTIBLE, 2046 FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION | LI_INTERRUPTIBLE,
2044}; 2047};
2045line_input_t *new_line_input_t(int flags) FAST_FUNC; 2048line_input_t *new_line_input_t(int flags) FAST_FUNC;