Use tmux. Ssh in and start a tmux session. If the connection breaks you can ssh back in and reconnect to the tmux session later.
GNU Screen is another alternative
Yes, thanks, but it does not work for me since X11 applications lose their connection too.
Yes, thanks, but it does not work for me since X11 applications lose their connection too.