Use the following setting to prevent Xshell from exiting when the connection is closed.
- From the Xshell tool bar, click Tools, and then Options.
RESULT: Options dialog box opens up. - Click the Advanced tab.
- In the Options area, select
...
- 'Revert to local shell
...
- when connection
...
- is closed'.
...