memset(&newtio, 0, sizeof(newtio));
// Set input mode (non-canonical, *no echo*,...)
tcsetattr(STDIN_FILENO, TCSANOW, &newtio);
- // Put the selected string in the tty input buffer
char control_q = '\021';
+ // Put the selected string in the tty input buffer
for(char *k = string; *k; k++) {
if(add_control_qs) {
+ // Add ^Q to quote control characters
ioctl(STDIN_FILENO, TIOCSTI, &control_q);
}
ioctl(STDIN_FILENO, TIOCSTI, k);
char pattern[buffer_size];
pattern[0] = '\0';
+
int cursor_position;
cursor_position = 0;
int key;
int current_line = 0, temporary_line = 0;
- update_screen(¤t_line, &temporary_line, 0, nb_lines, labels, cursor_position, pattern);
+ update_screen(¤t_line, &temporary_line, 0,
+ nb_lines, labels, cursor_position, pattern);
do {