8000 PyTerminal - expose the reference through the element (#1921) · woxtu/pyscript@355866a · GitHub
[go: up one dir, main page]

Skip to content

Commit 355866a

Browse files
PyTerminal - expose the reference through the element (pyscript#1921)
* PyTerminal - expose the reference through the element * [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 6eca06a commit 355866a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// PyScript py-terminal plugin
22
import { TYPES, hooks } from "../core.js";
33
import { notify } from "./error.js";
4+
import { defineProperty } from "polyscript/exports";
45

56
const SELECTOR = [...TYPES.keys()]
67
.map((type) => `script[type="${type}"][terminal],${type}-script[terminal]`)
@@ -76,6 +77,7 @@ const pyTerminal = async () => {
7677
terminal.open(target);
7778
fitAddon.fit();
7879
terminal.focus();
80+
defineProperty(element, "terminal", { value: terminal });
7981
};
8082

8183
// branch logic for the worker

0 commit comments

Comments
 (0)
0