Skip to content

Commit

Permalink
Use the buffered output stream at the correct location, jline#133
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jun 16, 2017
1 parent ae265f7 commit de2f031
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
package org.jline.terminal.impl.jansi.win;

import java.io.BufferedOutputStream;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOError;
Expand Down Expand Up @@ -36,7 +37,7 @@ public JansiWinSysTerminal(String name, boolean nativeSignals) throws IOExceptio
}

public JansiWinSysTerminal(String name, boolean nativeSignals, SignalHandler signalHandler) throws IOException {
super(new WindowsAnsiOutputStream(new FileOutputStream(FileDescriptor.out)),
super(new WindowsAnsiOutputStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out))),
name, nativeSignals, signalHandler);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
package org.jline.terminal.impl.jna.win;

import java.io.BufferedOutputStream;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
Expand All @@ -34,7 +35,7 @@ public JnaWinSysTerminal(String name, boolean nativeSignals) throws IOException
}

public JnaWinSysTerminal(String name, boolean nativeSignals, SignalHandler signalHandler) throws IOException {
super(new WindowsAnsiOutputStream(new FileOutputStream(FileDescriptor.out), consoleOut),
super(new WindowsAnsiOutputStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out)), consoleOut),
name, nativeSignals, signalHandler);
strings.put(InfoCmp.Capability.key_mouse, "\\E[M");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.jline.utils.ShutdownHooks;
import org.jline.utils.Signals;

import java.io.BufferedOutputStream;
import java.io.FilterInputStream;
import java.io.InputStream;
import java.io.IOError;
Expand Down Expand Up @@ -70,7 +69,7 @@ public AbstractWindowsTerminal(OutputStream output, String name, boolean nativeS
this.consoleOutputCP = getConsoleOutputCP();
setConsoleOutputCP(CODE_PAGE);
this.reader = new NonBlockingReader(getName(), new org.jline.utils.InputStreamReader(input, CHARSET));
this.writer = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(output), CHARSET));
this.writer = new PrintWriter(new OutputStreamWriter(output, CHARSET));
parseInfoCmp();
// Attributes
attributes.setLocalFlag(Attributes.LocalFlag.ISIG, true);
Expand Down

0 comments on commit de2f031

Please sign in to comment.