X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=selector.cc;h=31bf262b48248d9032531c2655e6086c8c6534b1;hb=5096c70784d53b70db47028d7ebc766f8c02f0bf;hp=cfb583e1fb5b408e502032b47227e11bb3feb89c;hpb=951d423cb3aa421a271c287d45702fb0072d4681;p=selector.git diff --git a/selector.cc b/selector.cc index cfb583e..31bf262 100644 --- a/selector.cc +++ b/selector.cc @@ -390,11 +390,11 @@ void update_screen(int *current_line, int *temporary_line, int motion, int main(int argc, char **argv) { if(!ttyname(STDIN_FILENO)) { - cerr << "Error: the standard input is not a tty." << endl; + cerr << "The standard input is not a tty." << endl; exit(1); } - char buffer[buffer_size]; + char buffer[buffer_size], raw_line[buffer_size];; int color_fg_modeline, color_bg_modeline; int color_fg_highlight, color_bg_highlight; @@ -543,9 +543,23 @@ int main(int argc, char **argv) { } while(nb_lines < nb_lines_max && !file.eof()) { - file.getline(buffer, buffer_size); - if(strcmp(buffer, "") != 0) { - char *s = buffer; + + file.getline(raw_line, buffer_size); + + if(strcmp(raw_line, "") != 0) { + + char *s, *t; + const char *u; + + s = buffer; + t = raw_line; + while(*t) { + u = unctrl(*t++); + while(*u) { *s++ = *u++; } + } + *s = '\0'; + + s = buffer; if(zsh_history && *s == ':') { while(*s && *s != ';') s++;