Experiment with a 100ms timeout on ESC (#416)

Related: #243
See: https://github.com/PowerShell/Win32-OpenSSH/issues/2275
This commit is contained in:
Leonard Hecker 2025-06-04 18:00:31 +02:00 committed by GitHub
parent 7e28e7291a
commit 03a4e399f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,10 +86,12 @@ impl Parser {
/// is just the result of the user literally pressing the Escape key.
pub fn read_timeout(&mut self) -> std::time::Duration {
match self.state {
// 100ms is a upper ceiling for a responsive feel. This uses half that,
// under the assumption that a really slow terminal needs equal amounts
// of time for I and O. Realistically though, this could be much lower.
State::Esc => time::Duration::from_millis(50),
// 100ms is a upper ceiling for a responsive feel.
// Realistically though, this could be much lower.
//
// However, there seems to be issues with OpenSSH on Windows.
// See: https://github.com/PowerShell/Win32-OpenSSH/issues/2275
State::Esc => time::Duration::from_millis(100),
_ => time::Duration::MAX,
}
}