On Fri, Jan 23, 2009 at 08:47:57PM -0800, Gautam Iyer wrote: >> Gautam, could you please be more specific with "highlight the >> selection" and how this works? I'm fairly new to the codebase and >> although not the biggest I've seen out there, it'd help a lot if you >> could point me directly to the parts of interest that you think are >> appropriate for the task. > > Look in screen.c:4116 (you might have to read a lot of the code before / > after to follow). Basically each character on screen is stored in two > arrays -- one for the character PVTS(r,p).text, and one for a bit mask > of the attributes PVTS(r,p).rend. > > Input from a child process is parsed by mrxvt (according to VT100 > specifications), and the data is put into these two arrays. When the > user selects some text, the corresponding characters in PVTS(r,p).rend > get bit number Rs_Blink set. When the text is drawn it will be > highlighted as blinking text. > > What you should do is add a byte to PVTS(r,p).rend. This will give 8 > extra bits of information (at the expense of a little more memory use). > One of these bits should be for the user selection -- selected text > should have it's own attribute, and not reuse the blink attribute. The > others can be used for user defined patterns. (It would be nice to > reserve at least one such bit for URL's, and incorporate some way for > the user to open them easily.)
You would of course have to add code that matches regexps against the scrollback buffer every time text on screen changes (and accordingly update the attributes above). This should be done in a somewhat smart way -- if a program is spewing 100's of lines of crap per second, then we shouldn't hog CPU by needlessly matching patterns. The user wont see this text, until he scrolls up, so we should only match when needed. We should do some sort of delayed matching -- only the text on screen is matched, and only close just before screen refreshes. This doesn't always correspond to output from the child, since mrxvt does some caching. If the child is spewing a lot of data, then mrvxt delays the refresh until the child stops making noise. If you think this will be more ellaborate than a small patch, then let me know and I can give you SVN access. You will however have to take a blood oath saying you will conform to the mrxvt coding guidelines before committing anything. GI -- 'Blamestorming' -- Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.
pgpgylog0alkz.pgp
Description: PGP signature
------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________ Materm-devel mailing list Materm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/materm-devel mrxvt home page: http://materm.sourceforge.net