terminado icon indicating copy to clipboard operation
terminado copied to clipboard

websocket server not closing connection when terminal is idle

Open dilip26 opened this issue 7 years ago • 3 comments
trafficstars

dilip26 avatar Apr 17 '18 08:04 dilip26

I'm not quite sure what you mean. It's not meant to close the connection when the terminal is idle. You don't know when some output might arrive and need to be sent to the frontend.

takluyver avatar Apr 17 '18 11:04 takluyver

What I meant is, I wanted to close the connection when there is no response from the end user for 10 minutes.

for eg, like SSH timeout "broken pipe" after few minutes if the user is inactive on the terminal it closes the connection with msg broken pipe Thank you in advance.

dilip26 avatar Apr 17 '18 11:04 dilip26

I thought that was just an error, not a feature ;-).

We use terminals in Jupyter, and we have this code in a subclass to track when a terminal was last active:

https://github.com/jupyter/notebook/blob/97b3b96f3dbec25390502a1bf1d4f113b6d16b59/notebook/terminal/handlers.py#L36-L42

You could use that to automatically close the terminal when its last activity was more than a certain time ago.

takluyver avatar Apr 17 '18 11:04 takluyver