From a4fc0119bed410478d8cc11e156daf788e2b7731 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Wed, 4 Jan 2023 09:55:18 +0100 Subject: [PATCH] vTerm: fix bug with new xterm.js --- packages.json | 2 +- vTerm/README.md | 1 + vTerm/build/debug/README.md | 1 + vTerm/build/debug/main.js | 2 +- vTerm/build/debug/package.json | 2 +- vTerm/build/release/vTerm.zip | Bin 2544 -> 2545 bytes vTerm/main.coffee | 3 +-- vTerm/package.json | 2 +- 8 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages.json b/packages.json index c3a3f25..49c049b 100644 --- a/packages.json +++ b/packages.json @@ -455,7 +455,7 @@ "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/vTerm/README.md", "category": "System", "author": "Xuan Sang LE", - "version": "0.1.19-a", + "version": "0.1.20-a", "dependencies": ["Antunnel@0.2.1-b","xTerm@5.1.0-r"], "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/vTerm/build/release/vTerm.zip" }, diff --git a/vTerm/README.md b/vTerm/README.md index d541120..bce13b9 100644 --- a/vTerm/README.md +++ b/vTerm/README.md @@ -12,6 +12,7 @@ VTerm depends on the server side **tunnel** plugin and the AntOS **Antunnel** client side package ## Change logs +- v0.1.20-fix bug with new xterm.js - v0.1.19-a Use the new xterm.js libraries v5.1.0 - v0.1.18-a support AntOS v2.0.x - v0.1.17-a update dependencies to latest diff --git a/vTerm/build/debug/README.md b/vTerm/build/debug/README.md index d541120..bce13b9 100644 --- a/vTerm/build/debug/README.md +++ b/vTerm/build/debug/README.md @@ -12,6 +12,7 @@ VTerm depends on the server side **tunnel** plugin and the AntOS **Antunnel** client side package ## Change logs +- v0.1.20-fix bug with new xterm.js - v0.1.19-a Use the new xterm.js libraries v5.1.0 - v0.1.18-a support AntOS v2.0.x - v0.1.17-a update dependencies to latest diff --git a/vTerm/build/debug/main.js b/vTerm/build/debug/main.js index 59ad576..1d46cd4 100644 --- a/vTerm/build/debug/main.js +++ b/vTerm/build/debug/main.js @@ -1 +1 @@ -(function(){var t;(t=class extends this.OS.application.BaseApplication{constructor(t){super("vTerm",t)}main(){var t;return this.mterm=this.find("myterm"),this.term=new Terminal({cursorBlink:!0}),this.fitAddon=new FitAddon.FitAddon,this.term.loadAddon(this.fitAddon),this.term.setOption("fontSize","12"),this.term.open(this.mterm),this.sub=void 0,this.bindKey("CTRL-SHIFT-C",t=>(this.mctxHandle({id:"copy"}),this.term.focus())),this.bindKey("CTRL-SHIFT-V",t=>this.mctxHandle({id:"paste"})),this.term.onKey(t=>{if(this.sub)return this.sub.send(Antunnel.Msg.DATA,new TextEncoder("utf-8").encode(t.key))}),this.on("focus",()=>this.term.focus()),this.mterm.contextmenuHandle=(t,e)=>(e.items=[{text:"__(Copy)",id:"copy"},{text:"__(Paste)",id:"paste"}],e.onmenuselect=t=>{if(t)return this.mctxHandle(t.data.item.data)},e.show(t)),this.resizeContent(),this.systemsetting.desktop.menu[this.name]||(this.systemsetting.desktop.menu[this.name]={text:"__(Open terminal)",app:"vTerm"}),this.on("resize",t=>this.resizeContent()),t=()=>Antunnel.tunnel?(this.tunnel=Antunnel.tunnel,this.openSession()):this._gui.pushService("Antunnel/AntunnelService").then(t=>{if(this.systemsetting.system.tunnel_uri)return Antunnel.init(this.systemsetting.system.tunnel_uri).then(t=>(this.notify(__("Tunnel now connected to the server at: {0}",this.systemsetting.system.tunnel_uri)),this.tunnel=Antunnel.tunnel,this.openSession())).catch(t=>(Antunnel.tunnel&&Antunnel.tunnel.close(),this.error(__("Unable to connect to the tunnel: {0}",t.toString()),t),this.quit()))}).catch(t=>(this.error(__("Unable to run Antunnel service: {0}",t.toString()),t),this.quit())),window.Antunnel?t():this._api.requires("pkg://Antunnel/main.js").then(()=>t()).catch(t=>(this.error(__("Unable to load Antunnel: {0}",t.toString()),t),this.quit()))}mctxHandle(t){var e,n;switch(t.id){case"paste":return e=t=>{if(t&&""!==t)return t=t.replace(/\n/g,"\r"),this.sub&&this.sub.send(Antunnel.Msg.DATA,new TextEncoder("utf-8").encode(t)),this.term.focus()},this._api.getClipboard().then(t=>e(t)).catch(t=>(this.error(__("Unable to paste"),t),this.openDialog("TextDialog",{title:"Paste text"}).then(t=>e(t)).catch(t=>this.error(t.toString(),t))));case"copy":if(!(n=this.term.getSelection())||""===n)return;return this._api.setClipboard(n)}}resizeContent(){var t,e,n;if(this.fitAddon.fit(),e=this.term.cols,n=this.term.rows,this.sub)return(t=new Uint8Array(8)).set(Antunnel.Msg.bytes_of(e,4),0),t.set(Antunnel.Msg.bytes_of(n,4),4),this.sub.send(Antunnel.Msg.CTRL,t)}openSession(){return this.term.clear(),this.term.focus(),this.sub=new Antunnel.Subscriber("vterm"),this.sub.onopen=()=>(console.log("Subscribed"),this.resizeContent($(this.mterm).width(),$(this.mterm).height()),this.term.focus()),this.sub.onerror=t=>(this.error(__("Unable to connect to: vterm"),t),this.sub=void 0),this.sub.onmessage=t=>{if(this.term&&t.data)return this.term.write(new TextDecoder("utf-8").decode(t.data))},this.sub.onclose=()=>(this.sub=void 0,this.notify(__("Terminal connection closed")),this.quit()),this.tunnel.subscribe(this.sub)}cleanup(t){if(this.sub)return this.sub.close()}}).dependencies=["pkg://xTerm/main.js","pkg://xTerm/main.css","pkg://Antunnel/main.js"],this.OS.register("vTerm",t)}).call(this); \ No newline at end of file +(function(){var t;(t=class extends this.OS.application.BaseApplication{constructor(t){super("vTerm",t)}main(){var t;return this.mterm=this.find("myterm"),this.term=new Terminal({cursorBlink:!0,fontSize:12}),this.fitAddon=new FitAddon.FitAddon,this.term.loadAddon(this.fitAddon),this.term.open(this.mterm),this.sub=void 0,this.bindKey("CTRL-SHIFT-C",t=>(this.mctxHandle({id:"copy"}),this.term.focus())),this.bindKey("CTRL-SHIFT-V",t=>this.mctxHandle({id:"paste"})),this.term.onKey(t=>{if(this.sub)return this.sub.send(Antunnel.Msg.DATA,new TextEncoder("utf-8").encode(t.key))}),this.on("focus",()=>this.term.focus()),this.mterm.contextmenuHandle=(t,e)=>(e.items=[{text:"__(Copy)",id:"copy"},{text:"__(Paste)",id:"paste"}],e.onmenuselect=t=>{if(t)return this.mctxHandle(t.data.item.data)},e.show(t)),this.resizeContent(),this.systemsetting.desktop.menu[this.name]||(this.systemsetting.desktop.menu[this.name]={text:"__(Open terminal)",app:"vTerm"}),this.on("resize",t=>this.resizeContent()),t=()=>Antunnel.tunnel?(this.tunnel=Antunnel.tunnel,this.openSession()):this._gui.pushService("Antunnel/AntunnelService").then(t=>{if(this.systemsetting.system.tunnel_uri)return Antunnel.init(this.systemsetting.system.tunnel_uri).then(t=>(this.notify(__("Tunnel now connected to the server at: {0}",this.systemsetting.system.tunnel_uri)),this.tunnel=Antunnel.tunnel,this.openSession())).catch(t=>(Antunnel.tunnel&&Antunnel.tunnel.close(),this.error(__("Unable to connect to the tunnel: {0}",t.toString()),t),this.quit()))}).catch(t=>(this.error(__("Unable to run Antunnel service: {0}",t.toString()),t),this.quit())),window.Antunnel?t():this._api.requires("pkg://Antunnel/main.js").then(()=>t()).catch(t=>(this.error(__("Unable to load Antunnel: {0}",t.toString()),t),this.quit()))}mctxHandle(t){var e,n;switch(t.id){case"paste":return e=t=>{if(t&&""!==t)return t=t.replace(/\n/g,"\r"),this.sub&&this.sub.send(Antunnel.Msg.DATA,new TextEncoder("utf-8").encode(t)),this.term.focus()},this._api.getClipboard().then(t=>e(t)).catch(t=>(this.error(__("Unable to paste"),t),this.openDialog("TextDialog",{title:"Paste text"}).then(t=>e(t)).catch(t=>this.error(t.toString(),t))));case"copy":if(!(n=this.term.getSelection())||""===n)return;return this._api.setClipboard(n)}}resizeContent(){var t,e,n;if(this.fitAddon.fit(),e=this.term.cols,n=this.term.rows,this.sub)return(t=new Uint8Array(8)).set(Antunnel.Msg.bytes_of(e,4),0),t.set(Antunnel.Msg.bytes_of(n,4),4),this.sub.send(Antunnel.Msg.CTRL,t)}openSession(){return this.term.clear(),this.term.focus(),this.sub=new Antunnel.Subscriber("vterm"),this.sub.onopen=()=>(console.log("Subscribed"),this.resizeContent($(this.mterm).width(),$(this.mterm).height()),this.term.focus()),this.sub.onerror=t=>(this.error(__("Unable to connect to: vterm"),t),this.sub=void 0),this.sub.onmessage=t=>{if(this.term&&t.data)return this.term.write(new TextDecoder("utf-8").decode(t.data))},this.sub.onclose=()=>(this.sub=void 0,this.notify(__("Terminal connection closed")),this.quit()),this.tunnel.subscribe(this.sub)}cleanup(t){if(this.sub)return this.sub.close()}}).dependencies=["pkg://xTerm/main.js","pkg://xTerm/main.css","pkg://Antunnel/main.js"],this.OS.register("vTerm",t)}).call(this); \ No newline at end of file diff --git a/vTerm/build/debug/package.json b/vTerm/build/debug/package.json index 1ea4c8d..1d5ab32 100644 --- a/vTerm/build/debug/package.json +++ b/vTerm/build/debug/package.json @@ -7,7 +7,7 @@ "author": "Xuan Sang LE", "email": "xsang.le@gmail.com" }, - "version":"0.1.19-a", + "version":"0.1.20-a", "category":"System", "iconclass":"bi bi-terminal-fill", "mimes":["none"], diff --git a/vTerm/build/release/vTerm.zip b/vTerm/build/release/vTerm.zip index b4f6d019fe1c982a38f2908a1055081afce5faba..a03bfe5bc4a38709ab7d6cd5c12ced647e6b93eb 100644 GIT binary patch delta 2352 zcmZ`*X*3(!7LGB7Dm7d~4Q&mrhKMogtr}v86cM2aHAG`55{lAli8)$o%B`7RRE;4m zQA(;4ni@(?(NxVrja41I8m{-&TkG}Swcb8I_FDVwv;Tbi`_8u^@mYd|w&vj#0ssI4 zfPPCACt5rmS;Y$gq#ObOfCp6q?lKV^5LV&LCe9j&?Mfw`IwXY7Yhsa2;+|}%xd#n` zo2we5$3?iYa_k^HMztDNUrt)jEF(5c$oPAl@bKmIu7=o1-+g^3H$J(o(vgo-P@n?B zPiUjFmdwnC7Ve?pTNf{_@l=--rAx0qs zqY|=&ki$UDPjB~V9zV^L;(iKG|((XqEw-$X6!)& zE}qce=#VCAEVUW^Tn3z@0o?V+GwY^<*Dl^C1-6i`msWbBqPm}Y4f1t48~&bBEdA40 z&a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+s@YFhX*e2?rL%x5P;S;KK>qZ1a!*8TPw|q{C6anc=28Yy zszbQ=%)x%Z6`7Vmsm=u5RoT9DoJFoJ9v^P?I0n`wOJhZ)N0Uqv@47DeA6IxNB^yh! z+Bj?smqo;@M8e zLw{QA*x3Hjh?c?DrH5h?9n5&HCa0}756JgR=61~YRekQF>L;9E9RDcne*cp1K4-hn z{!OxHdA3otR&91>x#{V)BdRbWjeuKHek1sd+AQ8;<~du&q5$bg4mQY6aM7hqqla9s zFK;VEW-j_hNNow^mhYx4d8#id3vMqPI=G>O^u%7h+JY~{xCqB$yiT0zUUb!|qg{un z)70Y|MLH7vZNuJdYc()sJBmJV`8+J}dYicO?9|xDiekEyjH`MUX<7haG0A}jUJtw*;!yU(UP+vUGJ{)8}p_7ZEKgnQUsvymfA z#p6>UH?QER492qAVr{ihcFE&{{Z8urS}FV5DUf0_7Qw?;Ghm;l#C|aRCpAjy_#+QH zM>F@=@}w<>VbkuR7F|>Q6MgUNN%1I+#-#LTi|+X>zVQo@UD-&9l_6 z29GRs%}MaC1JA{5;__1ZaFF+mLMi#&Z?hC8F|BLIS$ICJDDaVMzW4qCzJqcz*Z`2D zz*pynxmTV?wnc`D2>+qWqIl&M!ndf+BbZ)u++|ysbrn@<(ptjWe>FVuol@V%?Th&tc|)R6h?BN5*gn?Op~V?+oO?=Z8>G ze?Hq`H{L3D8i&>`tG4Jc(K#9tah^7WJok8$L-mFG?HVU5EgZV83~vN8_D0sP?Di6o z4~9VRpv^0g4P0$5trw4bt(NA^)yXENTc(y3_uWtT2>LcwbeTKQl2|f*d)ul4kz)Pw zB0^Qx4#AG{#OD23xna%c@~cIh)MnBNuN @mterm = @find "myterm" - @term = new Terminal { cursorBlink: true } + @term = new Terminal { cursorBlink: true, fontSize: 12 } @fitAddon = new FitAddon.FitAddon() @term.loadAddon(@fitAddon) - @term.setOption('fontSize', '12') @term.open @mterm @sub = undefined diff --git a/vTerm/package.json b/vTerm/package.json index 1ea4c8d..1d5ab32 100644 --- a/vTerm/package.json +++ b/vTerm/package.json @@ -7,7 +7,7 @@ "author": "Xuan Sang LE", "email": "xsang.le@gmail.com" }, - "version":"0.1.19-a", + "version":"0.1.20-a", "category":"System", "iconclass":"bi bi-terminal-fill", "mimes":["none"],