Last month I announced the first beta of my new node-red-contrib-xterm node, which integrated a terminal window inside a custom node. That terminal window allowed users to execute command line commands, via your flow editor.
But Steve (@shrickus) suggested that this terminal window should have been inside the flow editor sidebar, instead of in a node's config screen. Very good proposal, but writing my first sidebar node became a hell of a job. Since I had to start from scratch again ( ), I have started this new discussion to avoid users becoming confused with the first beta ...
So LOTS of changes:
The terminal window is now inside a sidebar tabsheet.
You can manually start / stop / clean the terminal via buttons.
All kind of server side information and errors are now also displayed inside the terminal window.
It should run on macOS, Linux and Windows. I have only tested it on Windows and Raspbian, so would be nice if somebody could test it on macOS!
The look-and-feel of the terminal window is customizable.
Your favorite commands can be stored in Terminal Input nodes.
Critical commands can be secured with a confirmation dialog.
It is possible to store a sequence of multiple commands, to store your own scripts.
Pre-build libraries are included (for the pseudo terminal code) for a number of systems, to avoid headache during installation.
...
You can install it directly from my Github repository, since it is not published on NPM yet:
npm install bartbutenaers/node-red-contrib-xterm
First demo to show how the sidebar tabsheet works:
I assume your os isn't available in that table? Not sure if you can ask those guys to add your platform ...
So the first time you press on the "Start" button, you get a popup with a message? Or a message inside the terminal screen, or ... ?
And you still remember what is was about?
Could you please explain what you have done in between? So you have opened your flow editor, done something else (with terminal tabsheet still open or switched to another tabsheet?), and when you came back the pseudoterminal had been stopped.
There is also a heartbeat every 5 seconds, send by the flow editor to the backend: when the backend doesn't get a heartbeat signal within 5 seconds, it decides that the flow editor has been closed (so it will close the pseudo terminal). Don't know whether that is perhaps the cause... I will make a change tonight so it will display "Pseudoterminal has been stopped due to heartbeat" in that situation. Then we have at least a bit more information for troubleshooting.
Perhaps my 5 seconds are a bit too optimistic if you use a cloud solution...
Thought all you guys were Raspberry freaks
It was a standard Node-RED type dialog that you get at the top - can't remember details
I just switched back to using my Win10 PC (I view Node-RED instances including this one via a Pi4 - I VNC into Pi4 and run browser from there)
I'll test it then
I am but can't see need for this on my Pi as I VNC into them all so easy to run terminals
But with Oracle Cloud Free Instances, it's a nightmare to get to terminal as its needs ssh certificate (took me 1 hour to find out which machine at my end I'd set it up from!)
So having terminal inside Node-RED could be handy
Also, could be a security risk as if anyone cracks my Node-RED admin password - they've got access to the cloud instance
Almost all of my node-RED flows now run on the Oracle Cloud Free Instance.
It's faster, less downtime and has better web connectivity than my Pi.
I only use my pi as a MQTT broker and run node-RED locally purely for administrative functions such as updating my Pi's DNS IP. (you get a fixed IP address for the Oracle instances).
Hey Simon,
There is a new version on Github with following changes:
The sidebar sends a heartbeat every 5 seconds, but the server will wait 15 seconds (and then the pseudo terminal will be stopped). Perhaps that can solve your issue...
The info panel of the Terminal-Input node now contains a security warning:
Before the terminal is started, the same security warning will also appear:
There is now a security section in the head of my readme page:
Spoke too soon. The first time I open the editor and go to the terminal window and press "play" the terminal tab just closes. second time it's fine and opens the terminal.
The black terminal window opens briefly and then the tabsheet closes, when I open the tabsheet again the terminal window is not open but the play button opens it correctly.