The moment a network terminal becomes unresponsive it's usually already disconnected on the other end, so you're not installing anything anymore. Closing the disconnected terminal window will then have no effect.
Note that interrupting an installation like that may lead to problems, especially when updating system packages such as the kernel. You should try to re-connect and restart the installation before you attempt to reboot the Pi, since it may not be able to boot with a partial update. Always use a terminal multiplexer (such as tmux
or screen
) when working over a network.