Skip to content

Commit

Permalink
PyTerminal - expose the reference through the element (#1921)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
WebReflection and pre-commit-ci[bot] committed Jan 3, 2024
1 parent 6eca06a commit 355866a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyscript.core/src/plugins/py-terminal.js
Original file line number Diff line number Diff line change
@@ -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]`)
Expand Down Expand Up @@ -76,6 +77,7 @@ const pyTerminal = async () => {
terminal.open(target);
fitAddon.fit();
terminal.focus();
defineProperty(element, "terminal", { value: terminal });
};

// branch logic for the worker
Expand Down

0 comments on commit 355866a

Please sign in to comment.