True, but the workflow you describe is not the natural one for Emacs.
Emacs has a built-in package called TRAMP [1] for remote work. You don't log into a distant server and open Emacs there, you use Emacs on your local PC and open the remote file naturally, using a syntax like /method:user@host:/path/to/file, but most often /-:host:/path/to/file (when using SSH access set as default, with your local user name). Except for the special file path it's just like for a local file.
Then when launching a shell command, or a full shell, or a grep or compile or whatnot from a buffer editing a remote file, Emacs will automatically launch the command remote machine too. That makes the experience rather transparent. It's possible to have multiple buffers editing files on different machines at the same time.
Emacs has a built-in package called TRAMP [1] for remote work. You don't log into a distant server and open Emacs there, you use Emacs on your local PC and open the remote file naturally, using a syntax like /method:user@host:/path/to/file, but most often /-:host:/path/to/file (when using SSH access set as default, with your local user name). Except for the special file path it's just like for a local file.
Then when launching a shell command, or a full shell, or a grep or compile or whatnot from a buffer editing a remote file, Emacs will automatically launch the command remote machine too. That makes the experience rather transparent. It's possible to have multiple buffers editing files on different machines at the same time.
[1] https://www.gnu.org/software/tramp/#Quick-Start-Guide