[Winbash-checkins] CVS: winbash/lib/readline rltty.c,1.4,1.5 terminal.c,1.1,1.2
Brought to you by:
enricobrunetta,
xks
From: kevin s. <xk...@us...> - 2002-03-25 16:17:19
|
Update of /cvsroot/winbash/winbash/lib/readline In directory usw-pr-cvs1:/tmp/cvs-serv3344/lib/readline Modified Files: rltty.c terminal.c Log Message: * use a block cursor * calculate screen size (height/weight) based on console size. Index: rltty.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/rltty.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- rltty.c 25 Mar 2002 10:45:42 -0000 1.4 +++ rltty.c 25 Mar 2002 16:17:15 -0000 1.5 @@ -909,6 +909,18 @@ rlScreenStart = (int)csbi.dwCursorPosition.Y * (int)csbi.dwSize.X + (int)csbi.dwCursorPosition.X; } + + /* once we have handle to stdout, reset + screen size based on console geometry */ + _rl_get_screen_size (0, 1); + + /* use a block cursor */ + { + CONSOLE_CURSOR_INFO cursor_info; + cursor_info.dwSize = 100; + cursor_info.bVisible = TRUE; + SetConsoleCursorInfo(hStdout, &cursor_info); + } } haveConsole |= INITIALIZED; } Index: terminal.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/terminal.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- terminal.c 25 Mar 2002 10:45:42 -0000 1.1 +++ terminal.c 25 Mar 2002 16:17:15 -0000 1.2 @@ -255,13 +255,17 @@ if ( (haveConsole & FOR_OUTPUT) && GetConsoleScreenBufferInfo(hStdout, &csbi) ) { - _rl_screenwidth = csbi.dwSize.X; - _rl_screenheight = csbi.dwSize.Y; + /* we want to be off by one so that line wrapping + does not get messed up */ + _rl_screenwidth = csbi.dwSize.X - 1; + _rl_screenheight = csbi.dwSize.Y - 1; } else { - _rl_screenwidth = 80; - _rl_screenheight = 24; + /* we want to be off by one so that line wrapping + does not get messed up */ + _rl_screenwidth = 80 - 1; + _rl_screenheight = 24 - 1; } _rl_screenchars = _rl_screenwidth * _rl_screenheight; } |