diff --git a/src/proc.h b/src/proc.h index ec28b2388..7a589c50c 100644 --- a/src/proc.h +++ b/src/proc.h @@ -403,6 +403,7 @@ class job_t : noncopyable_t { bool notified_of_stop{false}; /// Whether the exit status should be negated. This flag can only be set by the not builtin. + /// Two "not" prefixes on a single job cancel each other out. bool negate{false}; /// This job is disowned, and should be removed from the active jobs list. diff --git a/tests/checks/not.fish b/tests/checks/not.fish new file mode 100644 index 000000000..77a03c419 --- /dev/null +++ b/tests/checks/not.fish @@ -0,0 +1,10 @@ +#RUN: %fish %s + +not true +echo $status +# CHECK: 1 + +# Two "not" prefixes on a single job cancel each other out. +not not sh -c 'exit 34' +echo $status +# CHECK: 34