If I start an asynchronous ("backgrounded") process, some info, including the new process's PID, gets printed to the terminal before the process runs; for example
$ sleep 3 &  8217 $  + done sleep 3 $
Is there a way to have such info (especially the PID) printed at the start of every process, not just those that get started asynchronously?
The reason for wanting this is that, due to the peculiarities of my everyday working set up, often enough it happens that a synchronous long-running process fails to respond to
Ctrl-C. (Invariably, what makes these processes "long-running" is that they produce a lot more output than I had anticipated.) The surest way to stop such a process is to
kill -9 it from a different window, and it would be nice to have its PID readily on hand for this.
UPDATE: In my original post I neglected to mention that
Ctrl-Z is not an option. (I'm working on a shell running under Emacs, so
Ctrl-Z just suspends Emacs.)