I have a script that I use to automatically generate port forwards for SSH, since I am working in several terminal windows across different servers all day, and this checks whether or not the port has been mapped on my end, and if so bumps it with +1 until it finds a port that is available. Then it echos out the port forward info and just runs
ssh -L<port1>:localhost:<port2> <server>. Simple.
When I have a lot of output and can't remember what the ports were mapped to originally, I have to scroll all the way up (hard work) to find this. This made me think that there might be some sort of wrapper of some sort that makes it possible to just add a single or multiple lines of text on top, and then the ssh session beneath it? I took the liberty to draw up a basic sketch:
I have tried Googling this, but I am struggling to find anything. If this exists, the command might be something like this:
wrapper --text="Port forwards: L5901:localhost:5900, L8080:localhost:80" --command="ssh -L<port1>:localhost:<port2> <server>"
Maybe using screen for this is a solution as well, but I would want to be able to run the "whole thing" (adding the line of text + starting the SSH session beneath it) with one command.