const char control_q = '\021';
// Put the selected string in the tty input buffer
for(const char *k = string; *k; k++) {
- if(add_control_qs) {
+ if(add_control_qs && !(*k >= ' ' && *k <= '~')) {
// Add ^Q to quote control characters
ioctl(STDIN_FILENO, TIOCSTI, &control_q);
}