//////////////////////////////////////////////////////////////////////
-// This looks severely Linux-only ...
-
-void inject_into_tty_buffer(char *line) {
+void inject_into_tty_buffer(char *string) {
struct termios oldtio, newtio;
- tcgetattr(STDIN_FILENO,&oldtio);
+ tcgetattr(STDIN_FILENO, &oldtio);
memset(&newtio, 0, sizeof(newtio));
// Set input mode (non-canonical, *no echo*,...)
tcsetattr(STDIN_FILENO, TCSANOW, &newtio);
- // Put the selected line in the tty input buffer
- for(char *k = line; *k; k++) {
+ // Put the selected string in the tty input buffer
+ for(char *k = string; *k; k++) {
ioctl(STDIN_FILENO, TIOCSTI, k);
}
// Restore the old settings