This day while working an lawful elephantine-toughen
I asked myself how lawful
does this nice progress bar caught on the bottom line while smooth
writing scrolling text.
We wanted no more with a coworker to purchase a gaze at to reproduce it!
Fortunately, while being very bored in the tube a number of years aid, I
wrote a Headless VT100
emulator, so I
remembered some things and had a number of hints on the tactic it’d be completed, so
I started poking around with some Python code.
I remembered a number of instructions like
DECSTBM to scheme the
margins, and the diversified commands to drag the cursor up and down so I
started with this.
After some trials-and-errors bottom margin reservation and log
printing worked however the log were displayed on the toll road come the bottom
margin, now not the place the present started: survey possibilities are you’ll perchance shuffle an lawful
on the discontinuance of your terminal, it displays the progress bar at
toughen
the bottom, however the logs will delivery from the discontinuance, as if there grasp been no
progress bar.
While looking out to solve this with my coworker, we were discussing about
my implementation, and a random characteristic:
static void DECSC(struct lw_terminal *term_emul)
{
/*TODO: Set graphic rendition and charset.*/
struct lw_terminal_vt100 *vt100;
vt100 = (struct lw_terminal_vt100 *)term_emul->user_data;
vt100->saved_x = vt100->x;
vt100->saved_y = vt100->y;
}
and quickly we realized it changed into as soon as the missing fragment! Saving the cursor situation to restore it later!!
It soon began to survey like an grotesque undocumented, but practically working, … thing?
print(f"