This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch for termcap


Hello,

  I maintain the Pine package and I've found that the cygwin terminal does
not support the "scrollregion" capability. However, this is listed as one
of the capabilities of this terminal, under the linux terminal.

  Below you can find a program that shows you that this is true and a
patch for the termcap file.

  The reason I need this patch is so that Pine will work in the cygwin
terminal. This is not the only modification that is needed to make pine
work in the cygwin terminal, the other modification needs to be made in
Pine, and I submitted it already so that the package be updated (I can't
tell when that will happen though (I submitted it 24 hours ago and it has
not been uploaded yet).

  The patch should not break any application since it is removing a
capability that does not exist, Pine has 3 methods to write to the
screen. This patch will force Pine to choose one of the other methods. I
am not aware that a patch like this could break any application.

 Thank you for your consideration:

---scroll.c---
#include <curses.h>
#include <stdio.h>

/* This program should fix the screen to scroll only
 * from lines 10 to 15. It does so in the rxvt terminal
 * but not in the cygwin terminal, because that capability
 * is either broken or does not exist
 */

main()
{
int i;
for (i = 1; i < 25;i++)
  printf("%d\n",i);
tputs("\e[10;15r",1,putchar);
}
-----------

to compile scroll.c simply execute the command

gcc -o scroll scroll.c -lcurses

-------Patch for termcap----
164a165,181
> #
> # The Cygwin terminal lacks the scrollregion capability, but it is present
> # in the linux terminal capabilities list. This means that programs that
> # use this capability (like Pine) fail to print the screen correctly. The
> # appropriate action to take at this time is to remove this capability from
> # the terminal description until the scrollregion capability works in this
> # terminal. This also leads to a separation of the linux and cygwin
> # descriptions. The old description was
> #
> #cygwin:\
> #	:xn@:op=\E[39;49m:Km=\E[M:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:tc=linux:
> #
> # Log of change: Remove "cs=[%i%d;%dr:" from the merged description
> #			Eduardo Chappa (Pine maintainer) 10/07/02
> #
> #
>
166c183,204
< 	:xn@:op=\E[39;49m:Km=\E[M:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:tc=linux:
---
> 	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c:ue=\E[24m:\
> 	:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:\
> 	:vi=\E[?25l:
201c239
< 	:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
---
> 	:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
-------------------------THIS LINE DOES NOT BELONG TO THE PATCH--------

Thank you for your consideration.

-- 
Eduardo
http://www.math.washington.edu/~chappa/personal.html


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]