help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] Reverse Scrolling in BASH


From: Andrew Dixon
Subject: [Help-bash] Reverse Scrolling in BASH
Date: Tue, 28 Feb 2012 11:48:59 -0800

Hi all,

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 
1252          *       corner before this line?
1253          */
1254   RL_UNSETSTATE (RL_STATE_REDISPLAYING);
1255   _rl_release_sigint ();
1256 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]