diff --git a/builtins/set.def b/builtins/set.def index c4a7001..4b885cb 100644 --- a/builtins/set.def +++ b/builtins/set.def @@ -693,8 +693,11 @@ set_builtin (list) return (r); } } - else if (change_flag (flag_name, on_or_off) == FLAG_ERROR) + else if (flag_name == 'i' || change_flag (flag_name, on_or_off) == FLAG_ERROR) { + /* We disallow changing the 'i' flag from the set builtin, because it + confuses people. Also because setting it here is a no-op, and it just + messes up with the value of $- */ s[0] = on_or_off; s[1] = flag_name; s[2] = '\0';