Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

job control in scripts



Hello

In a script I have something like:

```
#!/usr/bin/env zsh

set -m

sleep 5 &
echo a
fg
echo x
```

Now this seems to behave as expected in zsh 5.4.1 at first (echo a, delay, echo x) ... but if I try to cancel the sleep command using CTRL-C after it's been "brought back" using `fg` that does not work. Instead it waits out the remaining time, and then cancels the script before `echo`ing the "x".

Bash on the other hand behaves as expected - pressing CTRL-C after the `fg` will interrupt the `sleep` (and also the rest of the script).

Is that intended behaviour? Is it configurable?

Thanks


Messages sorted by: Reverse Date, Date, Thread, Author