X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=selector.cc;h=a3d54dd1a3acd15b81097e4c3279883e8bc5c62b;hb=6761db2af5b3df278745de6342f74a6a4c206ea1;hp=fbd2d3dd59ed0c11632479b134e5023a3c2ce066;hpb=02e02dc836b8e55e0f9f54164b6b4bfa0fc5da81;p=selector.git diff --git a/selector.cc b/selector.cc index fbd2d3d..a3d54dd 100644 --- a/selector.cc +++ b/selector.cc @@ -70,10 +70,11 @@ void inject_into_tty_buffer(char *string) { 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);