General observation
I don't use macOS and I'm not sure what exactly you mean by "switching between desktops". In KDE Plasma I can set my terminal emulator window (or basically any window) to be displayed on all virtual desktops. I don't know if you can do it in macOS.
From the point of view of consumed resources this should be the best because it would show you not only the same commands and the same shell, but also the same terminal emulator. If I were you, I would first try to solve the problem this way.
Specific solution: tmux
As an alternative use tmux and attach to the same tmux session from as many terminals (terminal emulators) as you want. By default sole tmux creates a new session; tmux attach-session attaches to the most recently used (preferably unattached) session and the shortest alias is tmux a. So if you want to work with one tmux session only then
tmux a || tmux
is your universal command. Run it in many terminals (terminal emulators) and enjoy having access to the same instance(s) of your shell from everywhere. You need to do this as a certain user though. (I think sharing a tmux server between users is possible but it requires effort; using tmux as a certain user is straightforward. If your "switching between desktops" does not imply switching between users then the method should simply work.)
Notes: