FS#32055 - [linux,ncurses] arrow key not working in "make menuconfig"

Attached to Project: Arch Linux
Opened by Adam (adam900710) - Thursday, 18 October 2012, 06:53 GMT
Last edited by Tobias Powalowski (tpowa) - Friday, 26 October 2012, 16:29 GMT
Task Type Support Request
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When using "make menuconfig" to configure the kernel or any other things, the arrow key does not function as it should.

Up/Down don't make the cursor move and only "^[OA^[OB" is output in the last line of the screen.

Additional info:
* package version(s) ncurses 5.9-3 x86_64
* screenshot : https://docs.google.com/open?id=0BxpkL3ehzX3pMC1xVlBDZWxqdkk


Steps to reproduce:
Use make menuconfig to configure the kernel or another things(e.g. crosstool-ng)
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Friday, 26 October 2012, 16:29 GMT
Reason for closing:  Not a bug
Comment by Dave Reisner (falconindy) - Thursday, 18 October 2012, 08:09 GMT
It means that you're using a TERM variable that your terminal can't actually support. So... what terminal are you using, and what does 'echo $TERM' show?
Comment by Adam (adam900710) - Thursday, 18 October 2012, 08:22 GMT
I tried screen,xterm,linux,xterm-256color as $TERM, but no luck.
My terminal emulator is Terminal(from xfce4).

Also tried in tty, but also no luck.

So I don't think it has something to do with the $TERM env variable.
Comment by Adam (adam900710) - Thursday, 18 October 2012, 08:31 GMT
Also, if you compile a C source code into binary, the binary seems to be all right.
e.g.:

#include <ncurses.h>


WINDOW *create_newwin(int height, int width, int starty, int startx);
void destroy_win(WINDOW *local_win);

int main(int argc, char *argv[])
{ WINDOW *my_win;
int startx, starty, width, height;
int ch;

initscr(); /* Start curses mode */
cbreak(); /* Line buffering disabled, Pass on
* everty thing to me */
keypad(stdscr, TRUE); /* I need that nifty F1 */

height = 3;
width = 10;
starty = (LINES - height) / 2; /* Calculating for a center placement */
startx = (COLS - width) / 2; /* of the window */
printw("Press F1 to exit");
refresh();
my_win = create_newwin(height, width, starty, startx);

while((ch = getch()) != KEY_F(1))
{ switch(ch)
{ case KEY_LEFT:
destroy_win(my_win);
my_win = create_newwin(height, width, starty,--startx);
break;
case KEY_RIGHT:
destroy_win(my_win);
my_win = create_newwin(height, width, starty,++startx);
break;
case KEY_UP:
destroy_win(my_win);
my_win = create_newwin(height, width, --starty,startx);
break;
case KEY_DOWN:
destroy_win(my_win);
my_win = create_newwin(height, width, ++starty,startx);
break;
}
}

endwin(); /* End curses mode */
return 0;
}

WINDOW *create_newwin(int height, int width, int starty, int startx)
{ WINDOW *local_win;

local_win = newwin(height, width, starty, startx);
box(local_win, 0 , 0); /* 0, 0 gives default characters
* for the vertical and horizontal
* lines */
wrefresh(local_win); /* Show that box */

return local_win;
}

void destroy_win(WINDOW *local_win)
{
/* box(local_win, ' ', ' '); : This won't produce the desired
* result of erasing the window. It will leave it's four corners
* and so an ugly remnant of window.
*/
wborder(local_win, ' ', ' ', ' ',' ',' ',' ',' ',' ');
/* The parameters taken are
* 1. win: the window on which to operate
* 2. ls: character to be used for the left side of the window
* 3. rs: character to be used for the right side of the window
* 4. ts: character to be used for the top side of the window
* 5. bs: character to be used for the bottom side of the window
* 6. tl: character to be used for the top left corner of the window
* 7. tr: character to be used for the top right corner of the window
* 8. bl: character to be used for the bottom left corner of the window
* 9. br: character to be used for the bottom right corner of the window
*/
wrefresh(local_win);
delwin(local_win);
}

Comment by Dave Reisner (falconindy) - Thursday, 18 October 2012, 08:32 GMT
Do other ncurses applications work?

TERM directly correlates to terminfo, which directly correlates to the functionality/capabilities of the terminal. It has everything to do with the TERM variable and the associated terminfo being available/supported by your terminal. Unless you've messed with the stty or other terminal manipulation commands in your shell RC files, there's little else that could be at fault.
Comment by Adam (adam900710) - Thursday, 18 October 2012, 09:29 GMT
rtorrent and vifm both work fine using my default xterm-256color TERM.

So the problem may be the scripts that generate the menuconfig UI?
Comment by Allan McRae (Allan) - Thursday, 25 October 2012, 00:05 GMT
Unassigning me. Does not sound like ncurses issue if other programs work.
Comment by Adam (adam900710) - Friday, 26 October 2012, 09:59 GMT
I found the problem.

It is the cope-git which wrapped the oringinal make command caused the problem.
If I use /usr/bin/make, everything works fine as usual.

Please close the bug and thanks everyone.

Loading...