File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,11 @@ export class UnixTerminal extends Terminal {
189189 // than using the `net.Socket`/`tty.WriteStream` wrappers which swallow the
190190 // errors and cause the thread to block indefinitely.
191191 fs . write ( this . _fd , data , ( err , written ) => {
192+ // Requeue any partial writes
193+ if ( written < data . length ) {
194+ this . _writeQueue . unshift ( data . slice ( written ) ) ;
195+ }
196+
192197 if ( err ) {
193198 const errno = ( err as any ) . errno ;
194199 switch ( errno ) {
@@ -216,11 +221,6 @@ export class UnixTerminal extends Terminal {
216221 }
217222 }
218223
219- // Requeue any partial writes
220- if ( written < data . length ) {
221- this . _writeQueue . unshift ( data . slice ( written ) ) ;
222- }
223-
224224 // Using `setImmediate` here appears to corrupt the data, this may be what
225225 // the interleaving/dropped data comment is about in Node.js' tty module:
226226 // https://github.com/nodejs/node/blob/4cac2b94bed4bf02810be054e8f63c0048c66564/lib/tty.js#L106C1-L111C34
You can’t perform that action at this time.
0 commit comments