8000 Added @xterm/addon-web-links to the terminal (#2027) · pyscript/pyscript@c653296 · GitHub
[go: up one dir, main page]

Skip to content

Commit c653296

Browse files
Added @xterm/addon-web-links to the terminal (#2027)
* Added @xterm/addon-web-links to the terminal * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 44cd627 commit c653296

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

pyscript.core/package-lock.json

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyscript.core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pyscript/core",
3-
"version": "0.4.20",
3+
"version": "0.4.21",
44
"type": "module",
55
"description": "PyScript",
66
"module": "./index.js",
@@ -59,6 +59,7 @@
5959
"@rollup/plugin-terser": "^0.4.4",
6060
"@webreflection/toml-j0.4": "^1.1.3",
6161
"@xterm/addon-fit": "^0.10.0",
62+
"@xterm/addon-web-links": "^0.11.0",
6263
"chokidar": "^3.6.0",
6364
"codemirror": "^6.0.1",
6465
"eslint": "^9.0.0",

pyscript.core/rollup/3rd-party.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ const modules = {
5151
"xterm_addon-fit.js": fetch(`${CDN}/@xterm/addon-fit/+esm`).then((b) =>
5252
b.text(),
5353
),
54+
"xterm_addon-web-links.js": fetch(
55+
`${CDN}/@xterm/addon-web-links/+esm`,
56+
).then((b) => b.text()),
5457
"xterm.css": fetch(`${CDN}/xterm@${v("xterm")}/css/xterm.min.css`).then(
5558
(b) => b.text(),
5659
),

pyscript.core/src/plugins/py-terminal.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,15 @@ const workerReady = ({ interpreter, io, run, type }, { sync }) => {
134134

135135
const pyTerminal = async (element) => {
136136
// lazy load these only when a valid terminal is found
137-
const [{ Terminal }, { Readline }, { FitAddon }] = await Promise.all([
138-
import(/* webpackIgnore: true */ "../3rd-party/xterm.js"),
139-
import(/* webpackIgnore: true */ "../3rd-party/xterm-readline.js"),
140-
import(/* webpackIgnore: true */ "../3rd-party/xterm_addon-fit.js"),
141-
]);
137+
const [{ Terminal }, { Readline }, { FitAddon }, { WebLinksAddon }] =
138+
await Promise.all([
139+
import(/* webpackIgnore: true */ "../3rd-party/xterm.js"),
140+
import(/* webpackIgnore: true */ "../3rd-party/xterm-readline.js"),
141+
import(/* webpackIgnore: true */ "../3rd-party/xterm_addon-fit.js"),
142+
import(
143+
/* webpackIgnore: true */ "../3rd-party/xterm_addon-web-links.js"
144+
),
145+
]);
142146

143147
const readline = new Readline();
144148

@@ -167,6 +171,7 @@ const pyTerminal = async (element) => {
167171
const fitAddon = new FitAddon();
168172
terminal.loadAddon(fitAddon);
169173
terminal.loadAddon(readline);
174+
terminal.loadAddon(new WebLinksAddon());
170175
terminal.open(target);
171176
fitAddon.fit();
172177
terminal.focus();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare var r: any;
2+
declare var n: any;
3+
declare var t: {};
4+
export { r as WebLinksAddon, n as __esModule, t as default };

0 commit comments

Comments
 (0)
0