0

im trying to write a bash script and i want it to be able to divide the screen in 2 sections and show a message on one of them and the output of a command in the other without having to split the terminal window just like htop or nvtop. I looked it up everywhere and im not getting a place to start.

top segment: 
echo "now we are executing x command"

bottom segment:
sudo apt update -y
#above command's output
blablablablabla updating this and that 
updated 
your repositories work 
blablablablabla

image for reference : htop divisory lines

i looked everywhere on google and couldnt get a starting point, I also search for a way to leave a static header on the terminal with the command output refreshing underneat but still no luck finding something useful

  • 1
    Check https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/intro.html#WHATIS or some `tput` capabilities like `cuu1` to move the cursor – Diego Torres Milano Jan 18 '23 at 01:07
  • As a most basic feature, research how to have the `PS1` variable to always display at the top. It will involve using ansi escape sequences like `\032[m` . – shellter Jan 18 '23 at 02:06

1 Answers1

0

Your reference image is for bashtop

That github project code would likely give you hints on how to proceed for what you want.

Eric Marceau
  • 1,601
  • 1
  • 8
  • 11