I'm trying to link a web-based terminal with bash.
My current attempt to do so is spawning a shell pointing a FIFO pipe to its input, like this:
Terminal 1
$ mkfifo pipe
$ bash <> pipe
file1 file2 file4
Terminal 2
$ echo "ls" > pipe
As you might be able to tell, I am only getting command responses from spawning the shell in Terminal 1 (obviously). Is it possible for me to tell if bash is idle or not? I need to know when to show $PS1
on the client side.
If I run something like apt-get install curl -y
, the command is continuous and finishes when it finishes. I need to know when it is finished so that on the front-end, I can show the terminal prompt.
Any ideas?