Most shells allow for running processes to be toggled between running in the foreground versus in the background. You can optionally add two built-in commands to support this:
Move the process with id
pidto the foreground. The process should resume if it was paused. If
pidis not specified, then move the most recently launched process to the foreground.
Resume a paused background process. If
pidis not specified, then resume the most recently launched process.
You should keep a list of all existing processes (whether they are in the foreground or background) and their pids. Inside this list, you should also keep a
struct termios to store the terminal settings of each program.