I am running a project using a remote interpreter using an SSH connection (PyCharm professional 2016.3.3). When I have a connection everything works fine, but if my connection gets interrupted (either I accidentally close the laptop lid, enter sleep mode, or the wifi connection breaks momentarily for some unknown reason) then when I reconnect, my console session is terminated with Process finished with exit code -1
.
The output from the interactive console reads:
ssh://username@remote_server:22/usr/bin/python /home/some_path/.pycharm_helpers/pydev/pydevconsole.py 0 0
PyDev console: using IPython 5.1.0
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
>>> a = 1
>>> # At this point I break the connection and then re-establish it after about 1 min.
Process finished with exit code -1
In this example I disabled wifi, and then re-enabled, connecting to a different wifi source, and then connected back to the orignal wifi source. This happens moderately frequently (maybe once daily) and can be a real hindrance.
Is there perhaps a setting I can change to avoid this, or is there a more robust connection method to attach the console to the process running on the remote host? The ideal situation would be one where if I lost my connection with one wifi source and opened a connection with another then my process would not be killed.
NB - It is important that I can have an interactive session, as my work is research based and I would need to be able to interactively write and run code.
I am also looking for a solution to this problem. The only workaround that I can think of for now is to set the keep alive message interval to a very high value under Tools>Deployment>Configuration>Advance Options. Maybe this solves the problem that the process finishes (But I couldn't test this yet).