Simply wrap your shell with osc52pty to get OSC52 support in Terminal.app
But thank you for the share, it is interesting!
[1]: https://github.com/roy2220/osc52pty/blob/master/oscexecutor....
You can wrap your ssh session with it and you’re done.
It’s very elegant and multiple orders of magnitude less complex than something like tmux.