mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-05 13:50:32 +00:00
parent
6cfd957697
commit
932ab00a53
@ -19,14 +19,34 @@
|
|||||||
attach(this.Xterm);
|
attach(this.Xterm);
|
||||||
}
|
}
|
||||||
})(function (Xterm) {
|
})(function (Xterm) {
|
||||||
Xterm.prototype.attach = function (socket, bidirectional) {
|
Xterm.prototype.attach = function (socket, bidirectional, buffered) {
|
||||||
var term = this;
|
var term = this;
|
||||||
|
|
||||||
bidirectional = (typeof bidirectional == 'undefined') ? true : bidirectional;
|
bidirectional = (typeof bidirectional == 'undefined') ? true : bidirectional;
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
|
|
||||||
|
term._flushBuffer = function () {
|
||||||
|
term.write(term._attachSocketBuffer);
|
||||||
|
term._attachSocketBuffer = null;
|
||||||
|
clearTimeout(term._attachSocketBufferTimer);
|
||||||
|
term._attachSocketBufferTimer = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
term._pushToBuffer = function (data) {
|
||||||
|
if (term._attachSocketBuffer) {
|
||||||
|
term._attachSocketBuffer += data;
|
||||||
|
} else {
|
||||||
|
term._attachSocketBuffer = data;
|
||||||
|
setTimeout(term._flushBuffer, 10);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
term._getMessage = function (ev) {
|
term._getMessage = function (ev) {
|
||||||
term.write(ev.data);
|
if (buffered) {
|
||||||
|
term._pushToBuffer(ev.data);
|
||||||
|
} else {
|
||||||
|
term.write(ev.data);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
term._sendData = function (data) {
|
term._sendData = function (data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user