I work on multiple projects on macOS and I just keep each project in its own desktop. Each project desktop just has its own terminal and text editor. I also have keyboard shortcuts set up so that I can easily move between desktops and move between the terminal and text editor within a desktop.