In SshSession.cs near line 1209 in the internal T WaitFor<T,S>(FinishCheck<T,S> finishCheck, int timeout, WaitFlags flags, S state, T timeoutDefaultValue, T closeDefaultValue)
function there seems to be an error of misinterpretation about timeouts.
When scripting, I expect the timeout value to measure the time between receipt of data from the terminal. I encountered a case where my timeout value was shorter than the keepalive frequency set by the server. In this case, the keepalive packets from the server were resetting the timeout monitor, but the terminal wasn't returning any data, so my scripting never timeout, and I got stuck.