I've been thinking lately that it would be really cool if bash scrolled up instead of down. When I'm working on my laptop, I want to be looking at the top of the screen instead of the bottom. So, I'm trying to hack this feature into bash and I was wondering if anyone can point me in the right direction.
I think(tm) the right place to do this is in lib/readline/display.c. Specifically the rl_redisplay() function (see below). If I understand this correctly, we've created rl_outstream which is the line that we want to print and fflush will actually print it to the terminal. So, I want to modify rl_outstream so that the prompt is on top instead of on the bottom. Does that sound right? Any hints tips or tricks would be greatly appreciated.
Thanks,
Andrew
492 /* Basic redisplay algorithm. */
493 void
494 rl_redisplay ()Â
495 {
<snip>
1229 Â Â Â Â /* ADD - figure out what fflush does. I think this is the final step beforeÂ
1230 Â Â Â Â Â * Â Â Â we output to the screen
1231 Â Â Â Â Â */
1232 Â fflush (rl_outstream);
1233Â
<snip>
1250Â
1251 Â Â Â Â /* ADD - Seems like this is important. Can we set the prompt to the upper leftÂ