Executing a command with terminal widget programatically?
I want to run a command within the terminal widget, and I want to control when it is executed. I tried achieving this through myterm.term.write('somecommand'); with no success. Also I've looked into pty.js and term.js and don't really have any good ideas.
Is there a way to do this?
Not going to close this issue just yet since I'm not sure how reliable this is, but changing the shell variable in the instantiation of the terminal widget, and recreating the terminal each time a different command is desired may suffice.
I am interested in executing command too, any solution?
@bogomips it's been 2 years and still no, unfortunately
As you suggested I changed the shell variable. Right now I am trying blessed-xterm that explicitly supports "spawn".
spawn (shell: String, args: String[], cwd?: String, env?: Object): Void: Spawn/run a command, optionally first terminating a currently running one.
@bogomips any luck?
I created this framework and for writing functional / automation tests of CLI apps. https://github.com/cancerberoSgx/cli-driver/tree/master/packages/cli-driver A similar API than web-driver - consume - waitFor and write. I have success for inquirer and blessed based Apps. Also vim, emacs and even some CLI games. In blessed Apps be careful to strip ansi-strings before asserting against them since its full of them.
@cancerberoSgx I'll check out your repo!