|
26 | 26 |
|
27 | 27 | public class DumbTerminal extends AbstractTerminal {
|
28 | 28 |
|
| 29 | + private final TerminalProvider provider; |
| 30 | + private final SystemStream systemStream; |
29 | 31 | private final NonBlockingInputStream input;
|
30 | 32 | private final OutputStream output;
|
31 | 33 | private final NonBlockingReader reader;
|
32 | 34 | private final PrintWriter writer;
|
33 | 35 | private final Attributes attributes;
|
34 | 36 | private final Size size;
|
35 |
| - private final SystemStream systemStream; |
36 | 37 |
|
37 | 38 | public DumbTerminal(InputStream in, OutputStream out) throws IOException {
|
38 | 39 | this(TYPE_DUMB, TYPE_DUMB, in, out, null);
|
39 | 40 | }
|
40 | 41 |
|
41 | 42 | public DumbTerminal(String name, String type, InputStream in, OutputStream out, Charset encoding)
|
42 | 43 | throws IOException {
|
43 |
| - this(name, type, in, out, encoding, SignalHandler.SIG_DFL, null); |
| 44 | + this(null, null, name, type, in, out, encoding, SignalHandler.SIG_DFL); |
44 | 45 | }
|
45 | 46 |
|
46 | 47 | @SuppressWarnings("this-escape")
|
47 | 48 | public DumbTerminal(
|
| 49 | + TerminalProvider provider, |
| 50 | + SystemStream systemStream, |
48 | 51 | String name,
|
49 | 52 | String type,
|
50 | 53 | InputStream in,
|
51 | 54 | OutputStream out,
|
52 | 55 | Charset encoding,
|
53 |
| - SignalHandler signalHandler, |
54 |
| - SystemStream systemStream) |
| 56 | + SignalHandler signalHandler) |
55 | 57 | throws IOException {
|
56 | 58 | super(name, type, encoding, signalHandler);
|
| 59 | + this.provider = provider; |
| 60 | + this.systemStream = systemStream; |
57 | 61 | NonBlockingInputStream nbis = NonBlocking.nonBlocking(getName(), in);
|
58 | 62 | this.input = new NonBlockingInputStream() {
|
59 | 63 | @Override
|
@@ -98,7 +102,6 @@ public int read(long timeout, boolean isPeek) throws IOException {
|
98 | 102 | this.attributes.setControlChar(ControlChar.VKILL, (char) 21);
|
99 | 103 | this.attributes.setControlChar(ControlChar.VLNEXT, (char) 22);
|
100 | 104 | this.size = new Size();
|
101 |
| - this.systemStream = systemStream; |
102 | 105 | parseInfoCmp();
|
103 | 106 | }
|
104 | 107 |
|
@@ -140,7 +143,7 @@ public void setSize(Size sz) {
|
140 | 143 |
|
141 | 144 | @Override
|
142 | 145 | public TerminalProvider getProvider() {
|
143 |
| - return null; |
| 146 | + return provider; |
144 | 147 | }
|
145 | 148 |
|
146 | 149 | @Override
|
|
0 commit comments