Explorar el Código

Flush StreamWriter for Shell shortcut operation

olegkap_cp hace 14 años
padre
commit
699163773b
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      Renci.SshClient/Renci.SshNet/SshClient.cs

+ 3 - 1
Renci.SshClient/Renci.SshNet/SshClient.cs

@@ -262,7 +262,9 @@ namespace Renci.SshNet
             this.EnsureConnection();
 
             var inputStream = new MemoryStream();
-            new StreamWriter(inputStream, encoding).Write(input);
+            var writer = new StreamWriter(inputStream, encoding);
+            writer.Write(input);
+            writer.Flush();
             inputStream.Seek(0, SeekOrigin.Begin);
 
             return this.CreateShell(inputStream, output, extendedOutput, terminalName, columns, rows, width, height, terminalMode, bufferSize);