# \[ANNOUNCE\]node-red-contrib-xterm : second beta (sidebar)

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718>\
**Category:** Share Your Nodes\
**Created:** [30 December 2019 00:16 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718 "2019-12-30T00:16:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [30 December 2019 00:16 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/1 "2019-12-30T00:16:47Z")

</div>

Hi folks,

Last month I [announced](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-beta-help-needed/18170) the first beta of my new [node-red-contrib-xterm](https://github.com/bartbutenaers/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:

```auto
npm install bartbutenaers/node-red-contrib-xterm

```

First demo to show how the sidebar tabsheet works:

 ![xterm_demo_sidebar](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/85ca7a6289b8c185152768a17afaaf1d20721d2d.gif)

And a second demo to show how you can use _ **Terminal Input nodes** _ to store your favorite commands in your Node-RED flow:

 ![xterm_demo_input](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/dc2ff7c6ad6ebf91b88f3567841720fd0d6f1cb7.gif)

More demo's are available on my Github repository (link above).  
As usual all '_constructive_' feedback is more than welcome!

Hope you like this node as much as I do ...  
Have fun!

Bart

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 December 2019 10:41 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/2 "2019-12-30T10:41:23Z")

</div>

> [@BartButenaers](#):
>
> npm install bartbutenaers/node-red-contrib-xterm

Just a note for anyone trying this on an Oracle Cloud Free Instance - you'll need to install git and gcc-c++ (which uses yum instead of apt)

```auto
sudo yum install git

```

```auto
sudo yum install gcc-c++

```

before running the npm command

Once it was installed - the first time I ran it - I got a message about did I want to leave, but it seems to work the second time I pressed play  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/226a89b77b1d696aa5bdba3c5972f3c0761f1b0e.png)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 December 2019 10:43 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/3 "2019-12-30T10:43:46Z")

</div>

Maybe spoke too soon - I got this when I switched back to viewing it  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/97dc876a28341cbd326f124f78adfec2b78d8951.png)

but worked again when I pressed play and did a ps aux

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cfb45c5cdbbfec66938361521523d15589db9970.jpeg)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [30 December 2019 13:23 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/4 "2019-12-30T13:23:46Z")

</div>

Hey Simon,  
Thanks for testing it!!

> [@cymplecy](#):
>
> Just a note for anyone trying this on an Oracle Cloud Free Instance - you'll need to install git and gcc-c++ (which uses yum instead of apt)

I use these prebuild binaries under the cover: [node-pty-prebuilt-multiarch](https://github.com/oznu/node-pty-prebuilt-multiarch):

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/ebdff91aac6544b490e3f043b618f73f9ff03262.png)

I assume your os isn't available in that table? Not sure if you can ask those guys to add your platform ...

> [@cymplecy](#):
>
> the first time I ran it - I got a message about did I want to leave

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?

> [@cymplecy](#):
>
> I got this when I switched back to viewing it

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 😉

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [30 December 2019 13:35 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/5 "2019-12-30T13:35:39Z")

</div>

@BartButenaers

Amazing!!!

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 December 2019 13:36 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/6 "2019-12-30T13:36:46Z")

</div>

> [@BartButenaers](#):
>
> And you still remember what is was about?

It was a standard Node-RED type dialog that you get at the top - can't remember details

> [@BartButenaers](#):
>
> Could you please explain what you have done in between

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)

> [@BartButenaers](#):
>
> I will make a change tonight so it will display " _Pseudoterminal has been stopped due to heartbeat_ "

I'll test it then

> [@BartButenaers](#):
>
> Thought all you guys were Raspberry freaks

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

I'm sure @TotallyInformation will be along shortly to tell me off! 🙂

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [30 December 2019 13:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/7 "2019-12-30T13:48:29Z")

</div>

> [@cymplecy](#):
>
> I'm sure @TotallyInformation will be along shortly to tell me off!

BTW Julian already has given some basic [feedback](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-beta-help-needed/18170/5) about security for my first beta version.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 December 2019 14:07 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/8 "2019-12-30T14:07:07Z")

</div>

If you guys don't get it by now, you're a lost cause 🤣

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [30 December 2019 22:37 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/9 "2019-12-30T22:37:23Z")

</div>

> [@BartButenaers](#):
>
> Thought all you guys were Raspberry freaks

Not at all!

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).

The OS used is 'Oracle Linux 7.7'

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [30 December 2019 23:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/10 "2019-12-30T23:22:19Z")

</div>

> [@cymplecy](#):
>
> I'll test it then

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](https://github.com/bartbutenaers/node-red-contrib-xterm/blob/master/README.md) page:

- When the pseudo terminal is stopped (on the server), one of the following **stop reasons** will be returned:

QUESTION: By talking about security, _ **I am now wondering if my httpAdmin endpoint is secured enough** _:

```auto
RED.httpAdmin.get('/xterm_shell/:terminal_id/:command/:info', function(req, res) {

```

Or should I do something special for **permissions** , to avoid that everybody can call the endpoint?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [31 December 2019 09:00 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/11 "2019-12-31T09:00:25Z")

</div>

JFI - I decided I'd try and update it using itself as the terminal - but when I pressed play - I got no reponse at all

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9a8681883b77c29fd4fd805ee9438aaf7a3a24ac.png)

(This was before I'd updated it)  
So I stopped Node-RED from a standard ssh session - updated the node and restarted NR and it worked fine  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1c38119cda362d858c200bebc49346038f07189f.png)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [31 December 2019 10:20 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/12 "2019-12-31T10:20:08Z")

</div>

No timeouts on this version - I've been out shopping and come back and its still alive 🙂 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/acc0f4e839403f2f75240b2e79485bc19ab78798.jpeg)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [31 December 2019 11:03 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/13 "2019-12-31T11:03:00Z")

</div>

> [@cymplecy](#):
>
> JFI - I decided I'd try and update it using itself as the terminal - but when I pressed play - I got no reponse at all

That is living on the edge...  
Will have a look at it later.

> [@cymplecy](#):
>
> No timeouts on this version - I've been out shopping and come back and its still alive 🙂

Unless you have been shopping less than 15 seconds, I call this good news 🤣

Thanks for all your (constructive) feedback, and my best wishes for 2020!  
Your Blockly question is on my agenda for next week 😉

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [31 December 2019 12:05 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/14 "2019-12-31T12:05:22Z")

</div>

Nice Bart, it's working well on my Manjaro laptop!

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [31 December 2019 12:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/15 "2019-12-31T12:22:36Z")

</div>

> [@BartButenaers](#):
>
> Will have a look at it later.

This was before I updated - it was on the old version - I was just letting you know

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [31 December 2019 12:23 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/16 "2019-12-31T12:23:57Z")

</div>

> [@BartButenaers](#):
>
> Your Blockly question is on my agenda for next week

We both know that nothing is going happen with blocky ☹

It is yesterday's forgotten node ☹

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [31 December 2019 14:18 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/17 "2019-12-31T14:18:02Z")

</div>

> [@ghayne](#):
>
> Nice Bart, it's working well on my Manjaro laptop!

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [31 December 2019 14:20 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/18 "2019-12-31T14:20:24Z")

</div>

I hit the same thing on both my mac and a pi

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [31 December 2019 14:23 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/19 "2019-12-31T14:23:08Z")

</div>

> [@ghayne](#):
>
> the terminal tab just closes

Hey Garry,  
Do you mean the black terminal window closes or the tabsheet itself? Any errors in the browser console log?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [31 December 2019 14:25 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718/20 "2019-12-31T14:25:40Z")

</div>

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.

[Next page](https://discourse.nodered.org/t/announce-node-red-contrib-xterm-second-beta-sidebar/19718.md?page=2)
