bartbutenaers / node-red-contrib-xterm

A Node-RED node terminal front-end, to execute backend CLI commands
Apache License 2.0
19 stars 3 forks source link

Fit the parent container #11

Closed bartbutenaers closed 4 years ago

bartbutenaers commented 4 years ago

Currently the terminal determines its own size, based on the specified rows and columns (via the options in its contstructor). As a result the node's config screen will become wider as expected.

However by using the fit addon, it is possible to have the terminal fit the parent DIV container. So will need to add the fit.js file to this repository...

See example here.

bartbutenaers commented 4 years ago

I have added a dependency to the xterm-addon-fit module, and load it's javascript file:

<script src="xterm_shell/undefined/undefined/js/xterm-addon-fit.js"></script>

That seems to be working, but I cannot do this (as described here:

const fitAddon = new FitAddon();

Because then I get an error that the constructor doesn't exist. Very weird because new Terminal() works fine, and that seems to be the same mechanism...

bartbutenaers commented 4 years ago

Solved