|
@@ -108,9 +108,20 @@ window.onload = async function()
|
|
on: function () {
|
|
on: function () {
|
|
const pty = this.getPTY();
|
|
const pty = this.getPTY();
|
|
console.log('PTY created', pty);
|
|
console.log('PTY created', pty);
|
|
|
|
+
|
|
|
|
+ // resize
|
|
|
|
+ ptt.on('ioctl.set', evt => {
|
|
|
|
+ console.log('event?', evt);
|
|
|
|
+ pty.resize(evt.windowSize);
|
|
|
|
+ });
|
|
|
|
+ ptt.TIOCGWINSZ();
|
|
|
|
+
|
|
|
|
+ // data from PTY
|
|
pty.on_payload = data => {
|
|
pty.on_payload = data => {
|
|
ptt.out.write(data);
|
|
ptt.out.write(data);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // data to PTY
|
|
(async () => {
|
|
(async () => {
|
|
// for (;;) {
|
|
// for (;;) {
|
|
// const buff = await ptt.in.read();
|
|
// const buff = await ptt.in.read();
|
|
@@ -205,6 +216,19 @@ window.onload = async function()
|
|
{ data, direction: WispPacket.SEND });
|
|
{ data, direction: WispPacket.SEND });
|
|
this.client.send(packet);
|
|
this.client.send(packet);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ resize ({ rows, cols }) {
|
|
|
|
+ console.log('resize called!');
|
|
|
|
+ const data = new DataBuilder({ leb: true })
|
|
|
|
+ .uint8(0xf0)
|
|
|
|
+ .uint32(this.streamId)
|
|
|
|
+ .uint16(rows)
|
|
|
|
+ .uint16(cols)
|
|
|
|
+ .build();
|
|
|
|
+ const packet = new WispPacket(
|
|
|
|
+ { data, direction: WispPacket.SEND });
|
|
|
|
+ this.client.send(packet);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
const ptyMgr = new PTYManager({
|
|
const ptyMgr = new PTYManager({
|