RXVT NCURSES BACKSPACE problem

2002-03-12 Thread Igor Bujna

Hello,
i install latest rxvt  ncurses from cygwin. I have this test program :
--
#include curses.h
#include ctype.h

#define COLOR21 
#define COLOR12 
   
int main () {
intc;
char *s;

initscr ();   
cbreak ();
noecho ();
start_color (); 
keypad (stdscr, TRUE);
curs_set(0);  
   
if (!has_colors ()) {
endwin ();
fputs (Hmm.. tady barvy nejdou !, stderr);
exit (1);
}
   
   
init_pair (COLOR1, COLOR_RED, COLOR_BLUE);   
init_pair (COLOR2, COLOR_YELLOW, COLOR_BLACK);
   
attron (COLOR_PAIR( COLOR1 ));   
mvaddstr (2, 5, Red on blue);
   
attron (COLOR_PAIR( COLOR2 ));
mvaddstr (3, 5, Yellow on black);
   
attron (A_BOLD);   
mvaddstr (4, 5, Yellow on black  BOLD);
   
attroff (COLOR_PAIR( COLOR2 ));  
mvaddstr (LINES-1, COLS-15, F10 - konec);
mvaddstr (10, 5, Name of keypad:);

while ( (c=getch()) != KEY_F(10)) {
s = (char *) keyname(c);   
if (s)
mvprintw (10, 20, '%s' - %i - %c , s, c, c);
else 
mvprintw (10, 20, '%c', (isprint(c) ? c : '.'));
}
   
erase (); 
refresh ();   
endwin ();   
exit (0);   
}
--
 After start bash and runing this program and pressing key BACKSPACE i 
get this  'KEY_BACKSPACE' - 263 - ^G .
When i start rxvt like this:
start c:/cygwin/bin/rxvt -fn Lucida ConsoleP-18 -tn rxvt-cygwin-native 
-geometry 100x39 -fg lightblue -bg midnightblue -vb -sr +sb -cr red -e 
/bin/bash
And run this program and pressing key BACKSPACE i get this '^?' - 127 - ^?
Where is problem???
Thanks



--
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/




Re: RXVT NCURSES BACKSPACE problem

2002-03-12 Thread Hack Kampbjørn

Igor Bujna wrote:
 
 Hello,
 i install latest rxvt  ncurses from cygwin. I have this test program :
 --
 #include curses.h
 #include ctype.h
 
 #define COLOR21
 #define COLOR12
 
 int main () {
 intc;
 char *s;
 
 initscr ();
 cbreak ();
 noecho ();
 start_color ();
 keypad (stdscr, TRUE);
 curs_set(0);
 
 if (!has_colors ()) {
 endwin ();
 fputs (Hmm.. tady barvy nejdou !, stderr);
 exit (1);
 }
 
 
 init_pair (COLOR1, COLOR_RED, COLOR_BLUE);
 init_pair (COLOR2, COLOR_YELLOW, COLOR_BLACK);
 
 attron (COLOR_PAIR( COLOR1 ));
 mvaddstr (2, 5, Red on blue);
 
 attron (COLOR_PAIR( COLOR2 ));
 mvaddstr (3, 5, Yellow on black);
 
 attron (A_BOLD);
 mvaddstr (4, 5, Yellow on black  BOLD);
 
 attroff (COLOR_PAIR( COLOR2 ));
 mvaddstr (LINES-1, COLS-15, F10 - konec);
 mvaddstr (10, 5, Name of keypad:);
 
 while ( (c=getch()) != KEY_F(10)) {
 s = (char *) keyname(c);
 if (s)
 mvprintw (10, 20, '%s' - %i - %c , s, c, c);
 else
 mvprintw (10, 20, '%c', (isprint(c) ? c : '.'));
 }
 
 erase ();
 refresh ();
 endwin ();
 exit (0);
 }
 --

Next time inlcude the compile line too it will save me to some manpages
for the exact -lncurses to use.

  After start bash and runing this program and pressing key BACKSPACE i
 get this  'KEY_BACKSPACE' - 263 - ^G .
 When i start rxvt like this:
 start c:/cygwin/bin/rxvt -fn Lucida ConsoleP-18 -tn rxvt-cygwin-native
 -geometry 100x39 -fg lightblue -bg midnightblue -vb -sr +sb -cr red -e
 /bin/bash
 And run this program and pressing key BACKSPACE i get this '^?' - 127 - ^?

If I start rxvt as just C:\cygwin\bin\rxvt.exe -e
c:/cygwin/bin/bash.exe --login I get Hmm.. tady barvy nejdou !
When I change the TERM=rxvt
I get 'KEY_BACKSPACE' - 263 - ^G too when pressing the backspace key.

 Where is problem???

It can be a combination of several factors choose the ones that applies:
 o Your presumptions about what the results should be
 o Your rxvt configuration (or lack hereof)
 o Not reading the documentation (man rxvt)
 o Not understanding the manpage
 o Overlooking the section about backspacekey
 o Not searching the mailing lists archives

Note my .Xdefaults look like this:
$ cat ~/.Xdefaults 
XTerm.scrollBar: False
XTerm.saveLines: 2000
XTerm.font: Lucida Console-16
Rxvt.backspacekey: ^H

 Thanks

-- 
Med venlig hilsen / Kind regards

Hack Kampbjørn

--
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/