I'm trying to make a chat program in Bash.
I've stumbled into a problem though: I have no idea how to have the input and output on the same screen.
What I mean by this is something like the Minecraft server console: the output displays at the top of the screen, and the bottom line of the program is a prompt to enter strings. The output never crosses over the bottom line of the program.
To accomplish this, I think I need to accomplish three things:
- 1 Somehow manage to run two tasks at once
- 2 Somehow manage to make these two tasks run in the same window
- 3 Somehow manage to keep the two tasks in invisible "boxes", that the output can't escape out of (for example, the "box" for the output would start from the top of the window and would end on the last line before the input)
How do I accomplish all of these?
scrolling regionwhich can give you your boxes. So you could set up a scrolling region and read a line and print it to a fifo or file in one process, and in a second you could read the file ... contcuprogram used 2 processes.tmux.talk.