shell.js icon indicating copy to clipboard operation
shell.js copied to clipboard

add text to shell screen without command input

Open ne0c0de opened this issue 1 year ago • 1 comments

Hi

I would like to use your script like a terminal screen but want ti add texts after initialize

is is possible to add more commands after initialize without user input?

something like:

const shell = Shell("#shell", ["Hello, world!"], { "user": "root", "host": "ctb", "responsive": true, "shadow": true,  }).type();
shell.write('additional output will be here').type();

is it possible?

ne0c0de avatar Aug 22 '22 14:08 ne0c0de

Hi @ne0c0de, thanks for the suggestion, is a quite interesting feature which makes me think to a possible improvement.

I'm thinking to move the commands parameter from the constructor to the type function, therefore each time type is invoked it prints the new set of commands in the same shell instance – maybe introducing the special clear command to empty the terminal.

I'm going to consider this feature, but I cannot predict when I will be able to develop it.

davidecaruso avatar Aug 23 '22 07:08 davidecaruso