From 89e2d123b83ad358e7bf45189cf4d144cd353d07 Mon Sep 17 00:00:00 2001 From: webreflection Date: Wed, 3 Jan 2024 16:12:06 +0100 Subject: [PATCH 1/2] PyTerminal - expose the reference through the element --- pyscript.core/src/plugins/py-terminal.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyscript.core/src/plugins/py-terminal.js b/pyscript.core/src/plugins/py-terminal.js index 1cf7a7407d7..1face890cb9 100644 --- a/pyscript.core/src/plugins/py-terminal.js +++ b/pyscript.core/src/plugins/py-terminal.js @@ -1,6 +1,7 @@ // PyScript py-terminal plugin import { TYPES, hooks } from "../core.js"; import { notify } from "./error.js"; +import { defineProperty } from "polyscript/exports"; const SELECTOR = [...TYPES.keys()] .map((type) => `script[type="${type}"][terminal],${type}-script[terminal]`) @@ -76,6 +77,7 @@ const pyTerminal = async () => { terminal.open(target); fitAddon.fit(); terminal.focus(); + defineProperty(element, 'terminal', { value: terminal }); }; // branch logic for the worker From 409895bab9deb6662b6441fa605b2119dd52d1a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:14:46 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyscript.core/src/plugins/py-terminal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyscript.core/src/plugins/py-terminal.js b/pyscript.core/src/plugins/py-terminal.js index 1face890cb9..9812ac2f21c 100644 --- a/pyscript.core/src/plugins/py-terminal.js +++ b/pyscript.core/src/plugins/py-terminal.js @@ -77,7 +77,7 @@ const pyTerminal = async () => { terminal.open(target); fitAddon.fit(); terminal.focus(); - defineProperty(element, 'terminal', { value: terminal }); + defineProperty(element, "terminal", { value: terminal }); }; // branch logic for the worker