From 9e6b449738e4073ea5e9ec3aa5b5928ae00a80dc Mon Sep 17 00:00:00 2001 From: shy Date: Thu, 12 Oct 2023 20:14:22 +0800 Subject: [PATCH] add some --- plugin/local/code/xterm.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/local/code/xterm.js b/plugin/local/code/xterm.js index e0535c95..a2ea5f50 100644 --- a/plugin/local/code/xterm.js +++ b/plugin/local/code/xterm.js @@ -64,6 +64,11 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireModules if (msg.IsErr()) { can.misc.Warn(msg.Result()) } can.onexport.term(can, term) }) }, _input: function(can, term, data) { + can.runAction(can.request({}, {rows: term.rows, cols: term.cols}, term._item), html.INPUT, [btoa(data)], function(msg) { + if (msg.IsErr()) { can.misc.Warn(msg.Result()) } + }), can._output = term._output + return + if (data == "\u0013") { can._delay = true can.onmotion.delay(can, function() { can._delay && can.runAction(can.request({}, term._item), html.INPUT, [btoa(data)], function(msg) { if (msg.IsErr()) { can.misc.Warn(msg.Result()) } @@ -71,9 +76,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireModules } else { if (can._delay) { can._delay = false; var msg = can.request({}, {_handle: ice.TRUE}, term._item) can._keylist = can.onkeymap._parse({key: data, _msg: msg}, can, mdb.NORMAL, can._keylist||[], term); return - } can._output = term._output, can.runAction(can.request({}, {rows: term.rows, cols: term.cols}, term._item), html.INPUT, [btoa(data)], function(msg) { + } + can.runAction(can.request({}, {rows: term.rows, cols: term.cols}, term._item), html.INPUT, [btoa(data)], function(msg) { if (msg.IsErr()) { can.misc.Warn(msg.Result()) } - }) + }), can._output = term._output } }, grow: function(can, msg) {