1. Set up SSH access to your PC (I recommend tailscale)
2. Install and start tmux session on your PC so it stays synced and survives disconnects and what not.
3. Install Termux, SSH into your PC, attach to the tmux session.
Bonus: tmux layout will scale nicely to your phone aspect ratio
You can also setup mosh connection if you expect signal to be frequently lost due to poor network quality, etc.