buttons executing custom commands or user menu like in mc
See original GitHub issue- Version (
cloudcmd -v
): v10.8.3 - Node Version
node -v
: v8.15.0 - OS (
uname -a
on Linux): Linux ulnoiotgw 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux - Browser name/version: all
- Used Command Line Parameters: N/A
- Changed Config: N/A
As most of my users completely fear the command line, I would like to be able to implement buttons (like for copy, mkdir, or console start) or a user menu (like happening on right click or like seen in midnight commander pressing F3) to execute some pre-defined commands in the respectively activated folder and showing their output while they are executing in the console.
How much effort would this be? Where would I have to start?
Usecase example
I have cloudcmd running on a headless raspberry pi that I control via the web using cloudcmd.
I just made a copy of a template source folder and now want to use the initialize
command to write this configuration to a microcontroller connected to the raspberry pi (or gateway computer). Now, I am starting the console per button press and type initialize
and look at the output. It would be nicer if I had some kind of deploy button executing initialize
in the right folder directly for me.
If there were multiple commands possible (initialize, deploy, upgrade), maybe a pop-up menu would make sense.
Issue Analytics
- State:
- Created 5 years ago
- Comments:48 (24 by maintainers)
Top GitHub Comments
Positive Update: running on the raspberry pi in latest raspbian, I don’t have the problems (and terminal re-opening in new environment works, too -> which means I can move ahead, yeah, thanks so much).
So, why does it not work on my desktop?
As mentioned in thread beginning, cloudcmd pi-configuration is this:
now upgraded to v11.8.3 and patched as advised (cloned from current http://github.com/ulno/cloudcmd)
My desktop:
same version of cloudcmd as on pi
Node Version
node -v
: v11.6.0 - that’s quite a differenceOS (
uname -a
on Linux): Linux ulno-t440p 4.19.16-1-MANJARO #1 SMP PREEMPT Fri Jan 18 17:03:05 UTC 2019 x86_64 GNU/Linux - the only thing which could have an impact here IMHO is the speed, my desktop is quite significantly faster than the pi (i7 4th gen quadcore with fast SSD), it also is not a Debian derivative, but an arch derivative (Manjaro)Any idea, what could cause this and let me know if I can help to track this down - but apart from that, I am pretty happy at this point as it seems to work well on the pi and I might show off cloudcmd in my IoT framework on Wednesday with some simple user menus!
Update: issues with icons are gone in 11.8.5
This is incorrect. The variable is set only once (first start of terminal) and never updated. Worse, when the shell or command in terminal quits/ends the respawned process doesn’t have the environment variables anymore at all. You have to refresh the cloudcmd and terminal browser page to access the variable again.
Also, when the path in cloudcmd is changed after terminal was started, the variable doesn’t change in the started program (of course - a fork has a copy of the environment of the process it was started from).
If we can’t find a quick fix for this, this renders all my efforts useless - see below for some ideas.
This works pretty well, I have spent a lot of time to convince terminal-kit to do something decent here and was kind of proud of my results (compare: https://github.com/ulno/ulnoiot/blob/master/bin/simple_shell.js, I wasted also a lot of time as I wanted to do it in python first, but python and ncurses is too slow for the raspberry pi, terminal-kit works good enough).
Unfortunately, this all falls apart as there is no way for me to get an updated path from cloudcmd.
Is there (1) a way to close the terminal window after an action is done (eventually adding a menu for different terminal sessions there - 1a) or (2) writing the paths always to a tmp-file or /var/run/cloudcmd that can be read before I execute something in the terminal, maybe the terminal should have an environment variable with an ID (2a) that refers to the temp file or a location in the tmp-file to allow multiple sessions?
I (and my students) would be very thankful if there would be a solution to this. I will start looking at cloudcmd code, if I can quickly hack solution 2 (2a can wait after my next class).