1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 13:52:55 +03:00

ssh: fix lost character after keyboard auth on windows

closes: https://github.com/wez/wezterm/issues/771
This commit is contained in:
Wez Furlong 2021-05-29 10:05:55 -07:00
parent 8931afba5c
commit eaa0d2f4d3
2 changed files with 9 additions and 9 deletions

View File

@ -28,6 +28,7 @@ As features stabilize some brief notes about them will accumulate here.
* New: bold and/or italics are now synthesized for fonts when the matching font is not actually italic or doesn't match the requested weight. [#815](https://github.com/wez/wezterm/issues/815) * New: bold and/or italics are now synthesized for fonts when the matching font is not actually italic or doesn't match the requested weight. [#815](https://github.com/wez/wezterm/issues/815)
* Updated: conpty.dll to v1.9.1445.0; fixes color bar artifacts when resizing window and allows win32 console applications to use mouse events * Updated: conpty.dll to v1.9.1445.0; fixes color bar artifacts when resizing window and allows win32 console applications to use mouse events
* Fixed: Windows: pane could linger after the process has died, closing only when a new pane/tab event occurs * Fixed: Windows: pane could linger after the process has died, closing only when a new pane/tab event occurs
* Fixed: Windows: first character after `wezterm ssh` keyboard authention was swallowed [#771](https://github.com/wez/wezterm/issues/771)
### 20210502-154244-3f7122cb ### 20210502-154244-3f7122cb

View File

@ -877,16 +877,15 @@ impl portable_pty::MasterPty for WrappedSshPty {
impl std::io::Write for PtyWriter { impl std::io::Write for PtyWriter {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> { fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
match self.writer.write(buf) { // Check for a new writer first: on Windows, the socket
Ok(len) if len > 0 => Ok(len), // will let us successfully write a byte to a disconnected
res => match self.rx.recv() { // socket and we won't discover the issue until we write
Ok(writer) => { // the next byte.
self.writer = writer; // <https://github.com/wez/wezterm/issues/771>
self.writer.write(buf) if let Ok(writer) = self.rx.try_recv() {
} self.writer = writer;
_ => res,
},
} }
self.writer.write(buf)
} }
fn flush(&mut self) -> std::io::Result<()> { fn flush(&mut self) -> std::io::Result<()> {