After bg %1 the job runs while the shell owns the terminal foreground. After fg %1 the running job owns the foreground. The terminal has one foreground group at a time.

Job control moves terminal foreground ownership between groups

Interactive job control lets a shell manage process groups that share a controlling terminal. The terminal has one foreground process group at a time, while other jobs can run or remain stopped in the background. Foreground ownership, running state, and the shell’s job table are distinct. A background job is not automatically suspended, and a stopped job has not necessarily terminated. ...

September 27, 2027 · 6 min · XB Field Notes