diff --git a/src/Renci.SshNet/Common/ChannelInputStream.cs b/src/Renci.SshNet/Common/ChannelInputStream.cs
new file mode 100644
index 000000000..f89a1e7e1
--- /dev/null
+++ b/src/Renci.SshNet/Common/ChannelInputStream.cs
@@ -0,0 +1,244 @@
+using System;
+using System.IO;
+using Renci.SshNet.Channels;
+
+namespace Renci.SshNet.Common
+{
+    /// 
+    /// ChannelInputStream is a one direction stream intended for channel data.
+    /// 
+    /// 
+    /// Copyright (c) 2016 Toni Spets (toni.spets@iki.fi)
+    /// 
+    /// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 
+    /// associated documentation files (the "Software"), to deal in the Software without restriction, 
+    /// including without limitation the rights to use, copy, modify, merge, publish, distribute, 
+    /// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
+    /// furnished to do so, subject to the following conditions:
+    /// 
+    /// The above copyright notice and this permission notice shall be included in all copies or 
+    /// substantial portions of the Software.
+    /// 
+    /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+    /// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
+    /// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
+    /// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
+    /// OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
+    /// OTHER DEALINGS IN THE SOFTWARE.
+    /// 
+    public class ChannelInputStream : Stream
+    {
+        #region Private members
+
+        /// 
+        /// Channel to send data to.
+        /// 
+        private readonly IChannelSession _channel;
+
+        /// 
+        /// Total bytes passed through the stream.
+        /// 
+        private long _totalPosition;
+
+        /// 
+        /// Indicates whether the current  is disposed.
+        /// 
+        private bool _isDisposed;
+
+        #endregion
+
+        internal ChannelInputStream(IChannelSession channel)
+        {
+            _channel = channel;
+        }
+
+        #region Stream overide methods
+
+        /// 
+        /// When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
+        /// 
+        /// An I/O error occurs.
+        /// Methods were called after the stream was closed.
+        /// 
+        /// Once flushed, any subsequent read operations no longer block until requested bytes are available. Any write operation reactivates blocking
+        /// reads.
+        /// 
+        public override void Flush()
+        {
+        }
+
+        /// 
+        /// When overridden in a derived class, sets the position within the current stream.
+        /// 
+        /// 
+        /// The new position within the current stream.
+        /// 
+        /// A byte offset relative to the origin parameter.
+        /// A value of type  indicating the reference point used to obtain the new position.
+        /// The stream does not support seeking, such as if the stream is constructed from a pipe or console output.
+        public override long Seek(long offset, SeekOrigin origin)
+        {
+            throw new NotSupportedException();
+        }
+
+        /// 
+        /// When overridden in a derived class, sets the length of the current stream.
+        /// 
+        /// The desired length of the current stream in bytes.
+        /// The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.
+        public override void SetLength(long value)
+        {
+            throw new NotSupportedException();
+        }
+
+        ///
+        ///When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
+        ///
+        ///
+        ///The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the stream is closed or end of the stream has been reached.
+        ///
+        ///The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
+        ///The maximum number of bytes to be read from the current stream.
+        ///An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
+        ///The sum of offset and count is larger than the buffer length.
+        ///Methods were called after the stream was closed.
+        ///The stream does not support reading.
+        /// is null.
+        ///An I/O error occurs.
+        ///offset or count is negative.
+        public override int Read(byte[] buffer, int offset, int count)
+        {
+            throw new NotSupportedException();
+        }
+
+        ///
+        ///When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
+        ///
+        ///The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
+        ///The number of bytes to be written to the current stream.
+        ///An array of bytes. This method copies count bytes from buffer to the current stream.
+        ///An I/O error occurs.
+        ///The stream does not support writing.
+        ///Methods were called after the stream was closed.
+        /// is null.
+        ///The sum of offset and count is greater than the buffer length.
+        ///offset or count is negative.
+        public override void Write(byte[] buffer, int offset, int count)
+        {
+            if (buffer == null)
+            {
+                throw new ArgumentNullException("buffer");
+            }
+
+            if (offset + count > buffer.Length)
+            {
+                throw new ArgumentException("The sum of offset and count is greater than the buffer length.");
+            }
+
+            if (offset < 0 || count < 0)
+            {
+                throw new ArgumentOutOfRangeException("offset", "offset or count is negative.");
+            }
+
+            if (_isDisposed)
+            {
+                throw CreateObjectDisposedException();
+            }
+
+            if (count == 0)
+            {
+                return;
+            }
+
+            _channel.SendData(buffer, offset, count);
+
+            _totalPosition += count;
+        }
+
+        /// 
+        /// Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
+        /// 
+        /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+        /// 
+        /// Disposing a  will interrupt blocking read and write operations.
+        /// 
+        protected override void Dispose(bool disposing)
+        {
+            base.Dispose(disposing);
+
+            if (!_isDisposed)
+            {
+                _isDisposed = true;
+                if (_totalPosition > 0 && _channel.IsOpen) {
+                    _channel.SendEof();
+                }
+            }
+        }
+
+        ///
+        ///When overridden in a derived class, gets a value indicating whether the current stream supports reading.
+        ///
+        ///
+        ///true if the stream supports reading; otherwise, false.
+        ///
+        public override bool CanRead
+        {
+            get { return false; }
+        }
+
+        /// 
+        /// When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
+        /// 
+        /// 
+        /// true if the stream supports seeking; otherwise, false.
+        ///
+        public override bool CanSeek
+        {
+            get { return false; }
+        }
+
+        /// 
+        /// When overridden in a derived class, gets a value indicating whether the current stream supports writing.
+        /// 
+        /// 
+        /// true if the stream supports writing; otherwise, false.
+        /// 
+        public override bool CanWrite
+        {
+            get { return true; }
+        }
+
+        /// 
+        /// When overridden in a derived class, gets the length in bytes of the stream.
+        /// 
+        /// 
+        /// A long value representing the length of the stream in bytes.
+        /// 
+        /// A class derived from Stream does not support seeking.
+        /// Methods were called after the stream was closed.
+        public override long Length
+        {
+            get { throw new NotSupportedException(); }
+        }
+
+        /// 
+        /// When overridden in a derived class, gets or sets the position within the current stream.
+        /// 
+        /// 
+        /// The current position within the stream.
+        /// 
+        /// The stream does not support seeking.
+        public override long Position
+        {
+            get { return _totalPosition; }
+            set { throw new NotSupportedException(); }
+        }
+
+        #endregion
+
+        private ObjectDisposedException CreateObjectDisposedException()
+        {
+            return new ObjectDisposedException(GetType().FullName);
+        }
+    }
+}
diff --git a/src/Renci.SshNet/Common/LinkedListQueue.cs b/src/Renci.SshNet/Common/LinkedListQueue.cs
new file mode 100644
index 000000000..13d03f9f9
--- /dev/null
+++ b/src/Renci.SshNet/Common/LinkedListQueue.cs
@@ -0,0 +1,143 @@
+using System;
+using System.Threading;
+
+namespace Renci.SshNet.Common
+{
+    /// 
+    /// Fast concurrent generic linked list queue.
+    /// 
+    internal class LinkedListQueue : IDisposable
+    {
+        sealed class Entry
+        {
+            public E Item;
+            public Entry Next;
+        }
+
+        private readonly object _lock = new object();
+
+        private Entry _first;
+        private Entry _last;
+
+        private bool _isAddingCompleted;
+
+        /// 
+        /// Gets whether this  has been marked as complete for adding and is empty.
+        /// 
+        /// Whether this queue has been marked as complete for adding and is empty.
+        public bool IsCompleted
+        {
+            get { return _isAddingCompleted && _first == null && _last == null; }
+        }
+
+        /// 
+        /// Gets whether this  has been marked as complete for adding.
+        /// 
+        /// Whether this queue has been marked as complete for adding.
+        public bool IsAddingCompleted
+        {
+            get { return _isAddingCompleted; }
+            set
+            {
+                lock (_lock)
+                {
+                    _isAddingCompleted = value;
+                }
+            }
+        }
+
+        /// 
+        /// Adds the item to .
+        /// 
+        /// The item to be added to the queue. The value can be a null reference.
+        public void Add(T item)
+        {
+            lock (_lock)
+            {
+                if (_isAddingCompleted)
+                {
+                    return;
+                }
+
+                var entry = new Entry()
+                {
+                    Item = item
+                };
+
+                if (_last != null)
+                {
+                    _last.Next = entry;
+                }
+
+                _last = entry;
+                _first ??= entry;
+
+                Monitor.PulseAll(_lock);
+            }
+        }
+
+        /// 
+        /// Marks the  instances as not accepting any more additions.
+        /// 
+        public void CompleteAdding()
+        {
+            lock (_lock)
+            {
+                IsAddingCompleted = true;
+                Monitor.PulseAll(_lock);
+            }
+        }
+
+        /// 
+        /// Tries to remove an item from the .
+        /// 
+        /// true, if an item could be removed; otherwise false.
+        /// The item to be removed from the queue.
+        /// Wait for data or fail immediately if empty.
+        public bool TryTake(out T item, bool wait)
+        {
+            lock (_lock)
+            {
+                if (_first == null && !wait)
+                {
+                    item = default;
+                    return false;
+                }
+
+                while (_first == null && !_isAddingCompleted)
+                {
+                    _ = Monitor.Wait(_lock);
+                }
+
+                if (_first == null && _isAddingCompleted)
+                {
+                    item = default;
+                    return false;
+                }
+
+                item = _first.Item;
+                _first = _first.Next;
+                return true;
+            }
+        }
+
+        /// 
+        /// Releases all resource used by the  object.
+        /// 
+        /// Call  when you are finished using the
+        /// . The  method leaves the
+        ///  in an unusable state. After calling
+        /// , you must release all references to the
+        ///  so the garbage collector can reclaim the memory that
+        /// the  was occupying.
+        public void Dispose()
+        {
+            lock (_lock)
+            {
+                _first = null;
+                _last = null;
+                _isAddingCompleted = true;
+            }
+        }
+    }
+}
diff --git a/src/Renci.SshNet/Common/Pipe.cs b/src/Renci.SshNet/Common/Pipe.cs
new file mode 100644
index 000000000..0ad0e433d
--- /dev/null
+++ b/src/Renci.SshNet/Common/Pipe.cs
@@ -0,0 +1,46 @@
+using System;
+
+namespace Renci.SshNet.Common
+{
+    /// 
+    /// A generic pipe to pass through data.
+    /// 
+    internal class Pipe : IDisposable
+    {
+        private readonly LinkedListQueue _queue;
+
+        /// 
+        /// Gets the input stream.
+        /// 
+        /// The input stream.
+        public PipeInputStream InputStream { get; private set; }
+
+        /// 
+        /// Gets the output stream.
+        /// 
+        /// The output stream.
+        public PipeOutputStream OutputStream { get; private set; }
+
+        public Pipe()
+        {
+            _queue = new LinkedListQueue();
+            InputStream = new PipeInputStream(_queue);
+            OutputStream = new PipeOutputStream(_queue);
+        }
+
+        /// 
+        /// Releases all resource used by the  object.
+        /// 
+        /// Call  when you are finished using the . The
+        ///  method leaves the  in an unusable state. After
+        /// calling , you must release all references to the
+        ///  so the garbage collector can reclaim the memory that the
+        ///  was occupying.
+        public void Dispose()
+        {
+            OutputStream.Dispose();
+            InputStream.Dispose();
+            _queue.Dispose();
+        }
+    }
+}
diff --git a/src/Renci.SshNet/Common/PipeInputStream.cs b/src/Renci.SshNet/Common/PipeInputStream.cs
new file mode 100644
index 000000000..1c16af40c
--- /dev/null
+++ b/src/Renci.SshNet/Common/PipeInputStream.cs
@@ -0,0 +1,135 @@
+using System;
+using System.IO;
+
+namespace Renci.SshNet.Common
+{
+    internal class PipeInputStream : Stream
+    {
+        private readonly LinkedListQueue _queue;
+        private byte[] _current;
+        private int _currentPosition;
+        private bool _isDisposed;
+
+        public PipeInputStream(LinkedListQueue queue)
+        {
+            _queue = queue;
+        }
+
+        public override void Flush()
+        {
+        }
+
+        public override long Seek(long offset, SeekOrigin origin)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override void SetLength(long value)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override int Read(byte[] buffer, int offset, int count)
+        {
+            if (buffer == null)
+            {
+                throw new ArgumentNullException("buffer");
+            }
+
+            if (offset + count > buffer.Length)
+            {
+                throw new ArgumentException("The sum of offset and count is greater than the buffer length.");
+            }
+
+            if (offset < 0 || count < 0)
+            {
+                throw new ArgumentOutOfRangeException("offset", "offset or count is negative.");
+            }
+
+            if (_isDisposed)
+            {
+                throw CreateObjectDisposedException();
+            }
+
+            var bytesRead = 0;
+
+            while (bytesRead < count)
+            {
+                if (_current == null || _currentPosition == _current.Length)
+                {
+                    if (!_queue.TryTake(out _current, (bytesRead == 0)))
+                    {
+                        _current = null;
+                        return bytesRead;
+                    }
+
+                    _currentPosition = 0;
+                }
+
+                var toRead = _current.Length - _currentPosition;
+                if (toRead > count - bytesRead)
+                {
+                    toRead = count - bytesRead;
+                }
+
+                Buffer.BlockCopy(_current, _currentPosition, buffer, offset + bytesRead, toRead);
+
+                _currentPosition += toRead;
+                bytesRead += toRead;
+            }
+
+            return bytesRead;
+        }
+
+        public override void Write(byte[] buffer, int offset, int count)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override bool CanRead
+        {
+            get { return !_isDisposed; }
+        }
+
+        public override bool CanSeek
+        {
+            get { return false; }
+        }
+
+        public override bool CanWrite
+        {
+            get { return false; }
+        }
+
+        public override long Length
+        {
+            get
+            {
+                throw new NotSupportedException();
+            }
+        }
+
+        public override long Position
+        {
+            get
+            {
+                throw new NotSupportedException();
+            }
+            set
+            {
+                throw new NotSupportedException();
+            }
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            base.Dispose(disposing);
+            _isDisposed = true;
+        }
+
+        private ObjectDisposedException CreateObjectDisposedException()
+        {
+            return new ObjectDisposedException(GetType().FullName);
+        }
+    }
+}
diff --git a/src/Renci.SshNet/Common/PipeOutputStream.cs b/src/Renci.SshNet/Common/PipeOutputStream.cs
new file mode 100644
index 000000000..8766c3475
--- /dev/null
+++ b/src/Renci.SshNet/Common/PipeOutputStream.cs
@@ -0,0 +1,128 @@
+using System;
+using System.IO;
+
+namespace Renci.SshNet.Common
+{
+    internal class PipeOutputStream : Stream
+    {
+        private readonly LinkedListQueue _queue;
+        private bool _isDisposed;
+
+        public PipeOutputStream(LinkedListQueue queue)
+        {
+            _queue = queue;
+        }
+
+        public override void Flush()
+        {
+        }
+
+        public override long Seek(long offset, SeekOrigin origin)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override void SetLength(long value)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override int Read(byte[] buffer, int offset, int count)
+        {
+            throw new NotSupportedException();
+        }
+
+        public override void Write(byte[] buffer, int offset, int count)
+        {
+            if (buffer == null)
+            {
+                throw new ArgumentNullException("buffer");
+            }
+
+            if (offset + count > buffer.Length)
+            {
+                throw new ArgumentException("The sum of offset and count is greater than the buffer length.");
+            }
+
+            if (offset < 0 || count < 0)
+            {
+                throw new ArgumentOutOfRangeException("offset", "offset or count is negative.");
+            }
+
+            if (_isDisposed || _queue.IsAddingCompleted)
+            {
+                throw CreateObjectDisposedException();
+            }
+
+            var tmp = new byte[count];
+            Buffer.BlockCopy(buffer, offset, tmp, 0, count);
+            _queue.Add(tmp);
+        }
+
+        public override bool CanRead
+        {
+            get { return false; }
+        }
+
+        public override bool CanSeek
+        {
+            get { return false; }
+        }
+
+        public override bool CanWrite
+        {
+            get { return !_isDisposed; }
+        }
+
+        public override long Length
+        {
+            get
+            {
+                throw new NotSupportedException();
+            }
+        }
+
+        public override long Position
+        {
+            get
+            {
+                throw new NotSupportedException();
+            }
+            set
+            {
+                throw new NotSupportedException();
+            }
+        }
+
+#if NETSTANDARD1_3
+        public void Close()
+#else
+        public override void Close()
+#endif
+        {
+            if (!_queue.IsAddingCompleted)
+            {
+                _queue.CompleteAdding();
+            }
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            base.Dispose(disposing);
+
+            if (!_isDisposed)
+            {
+                if (!_queue.IsAddingCompleted)
+                {
+                    _queue.CompleteAdding();
+                }
+                _isDisposed = true;
+            }
+        }
+
+        private ObjectDisposedException CreateObjectDisposedException()
+        {
+            return new ObjectDisposedException(GetType().FullName);
+        }
+    }
+}
diff --git a/src/Renci.SshNet/Properties/CommonAssemblyInfo.cs b/src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
index 0425d1fba..0883060cc 100644
--- a/src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
+++ b/src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
@@ -5,13 +5,13 @@
 [assembly: AssemblyDescription("SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.")]
 [assembly: AssemblyCompany("Renci")]
 [assembly: AssemblyProduct("SSH.NET")]
-[assembly: AssemblyCopyright("Copyright © Renci 2010-2017")]
+[assembly: AssemblyCopyright("Copyright © Renci 2010-2021")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
-[assembly: AssemblyVersion("2017.0.0")]
-[assembly: AssemblyFileVersion("2017.0.0")]
-[assembly: AssemblyInformationalVersion("2017.0.0-beta1")]
+[assembly: AssemblyVersion("2020.0.1")]
+[assembly: AssemblyFileVersion("2020.0.1")]
+[assembly: AssemblyInformationalVersion("2020.0.1")]
 [assembly: CLSCompliant(false)]
 
 // Setting ComVisible to false makes the types in this assembly not visible 
diff --git a/src/Renci.SshNet/SshCommand.cs b/src/Renci.SshNet/SshCommand.cs
index 13c00992a..584222126 100644
--- a/src/Renci.SshNet/SshCommand.cs
+++ b/src/Renci.SshNet/SshCommand.cs
@@ -29,6 +29,8 @@ public class SshCommand : IDisposable
         private StringBuilder _result;
         private StringBuilder _error;
         private bool _hasError;
+        private Pipe _stdoutPipe;
+        private Pipe _stderrPipe;
         private bool _isDisposed;
 
         /// 
@@ -61,7 +63,10 @@ public class SshCommand : IDisposable
         /// 
         ///