I think it\'s related to the parent process creating new subprocess and does not have tty. Can anyone explain the detail under the hood? i.e. the related working model of ba
You may need to enable job control:
#! /bin/bash set -m