input buffer, hence allowing the user to edit the line and execute it
as a standard command.
+Keys corresponding to ASCII codes between ' ' and '~' add a character
+to the pattern string. The Delete key, Backspace key, ^D and ^H delete
+one character from the pattern string.
+
+The up and down cursor keys move the selected line accordingly, and
+the PageUp and PageDown move by ten lines. The Home and End key moves
+to the top and the bottom of the list respectively. The return key
+select the current line and quit.
+
+You can cancel the selection either by interrupting the command with
+^C or by typing ^G.
+
.SH "OPTIONS"
.IP "\fB-h\fP" 10
display help and exits
.IP "\fB-v\fP" 10
inject the selected line into the tty input buffer
+.IP "\fB-m\fP" 10
+force the monochrome mode
.IP "\fB-t <color theme number>\fP" 10
select a color them
.IP "\fB-o <output filename>\fP" 10
int nb_lines_max = 10000;
char pattern_separator = ';';
int output_to_vt_buffer = 0;
-int with_colors = 0;
+int with_colors = 1;
//////////////////////////////////////////////////////////////////////
i++;
}
+ else if(strcmp(argv[i], "-m") == 0) {
+ with_colors = 0;
+ i++;
+ }
+
else if(strcmp(argv[i], "-f") == 0) {
check_opt(argc, argv, i, 1, "<input filename>");
strncpy(input_filename, argv[i+1], buffer_size);
<< " [-h]"
<< " [-b]"
<< " [-v]"
+ << " [-m]"
<< " [-t <color theme number>]"
<< " [-o <output filename>]"
<< " [-s <pattern separator>]"
initscr();
- if(has_colors()) {
- with_colors = 1;
- start_color();
- switch(theme) {
- default:
- case 0:
- init_pair(1, COLOR_WHITE, COLOR_GREEN);
- init_pair(2, COLOR_BLACK, COLOR_YELLOW);
- break;
- case 1:
- init_pair(1, COLOR_BLACK, COLOR_GREEN);
- init_pair(2, COLOR_BLACK, COLOR_YELLOW);
- break;
+ if(with_colors) {
+ if(has_colors()) {
+ start_color();
+ switch(theme) {
+ default:
+ case 0:
+ init_pair(1, COLOR_WHITE, COLOR_GREEN);
+ init_pair(2, COLOR_BLACK, COLOR_YELLOW);
+ break;
+ case 1:
+ init_pair(1, COLOR_BLACK, COLOR_GREEN);
+ init_pair(2, COLOR_BLACK, COLOR_YELLOW);
+ break;
+ }
+ } else {
+ with_colors = 0;
}
}
int motion = 0;
- if(key >= ' ' && key <= 'z') {
+ if(key >= ' ' && key <= '~') {
patterns[patterns_point++] = key;
patterns[patterns_point] = '\0';
}