mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Allow attach.js to work
This commit is contained in:
@@ -9,9 +9,7 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.min.js"></script>
|
||||
<script src="/build/xterm.js" ></script>
|
||||
|
||||
<!--
|
||||
<script src="/build/addons/attach/attach.js" ></script>
|
||||
-->
|
||||
<script src="/build/addons/zmodem/zmodemjs/dist/zmodem.js" ></script>
|
||||
<script src="/build/addons/zmodem/zmodem.js" ></script>
|
||||
|
||||
|
||||
+15
-9
@@ -125,15 +125,23 @@ function createTerminal() {
|
||||
start_form.style.display = "none";
|
||||
|
||||
if (document.getElementById("zmstart_yes").checked) {
|
||||
let zsession = detection.confirm();
|
||||
|
||||
current_zsession = zsession;
|
||||
try {
|
||||
term.detach();
|
||||
let zsession = detection.confirm();
|
||||
|
||||
if (zsession.type === "receive") {
|
||||
_handle_receive_session(zsession);
|
||||
current_zsession = zsession;
|
||||
|
||||
if (zsession.type === "receive") {
|
||||
_handle_receive_session(zsession);
|
||||
}
|
||||
else {
|
||||
_handle_send_session(zsession);
|
||||
}
|
||||
}
|
||||
else {
|
||||
_handle_send_session(zsession);
|
||||
catch(e) { throw e }
|
||||
finally {
|
||||
term.attach(socket);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -270,9 +278,7 @@ function abort_current_session() {
|
||||
}
|
||||
|
||||
function runRealTerminal() {
|
||||
term.on("data", (d) => {
|
||||
socket.send(d);
|
||||
});
|
||||
term.attach(socket);
|
||||
|
||||
term._initialized = true;
|
||||
}
|
||||
|
||||
@@ -19,12 +19,6 @@
|
||||
addon(window.Terminal);
|
||||
}
|
||||
})(function _zmodemAddon(Terminal) {
|
||||
for (let f of ["attach", "terminadoAttach"]) {
|
||||
if (Terminal.prototype[f]) {
|
||||
throw new Error(`The “zmodem” and “${f}” addons are mutually incompatible.`);
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(
|
||||
Terminal.prototype,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user