tty_cookedmode(): * Set the tty back to normal mode */
| 1061 | * Set the tty back to normal mode |
| 1062 | */ |
| 1063 | protected int |
| 1064 | tty_cookedmode(EditLine *el) |
| 1065 | { /* set tty in normal setup */ |
| 1066 | |
| 1067 | if (el->el_tty.t_mode == EX_IO) |
| 1068 | return 0; |
| 1069 | |
| 1070 | if (el->el_flags & EDIT_DISABLED) |
| 1071 | return 0; |
| 1072 | |
| 1073 | if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ex) == -1) { |
| 1074 | #ifdef DEBUG_TTY |
| 1075 | (void) fprintf(el->el_errfile, "%s: tty_setty: %s\n", __func__, |
| 1076 | strerror(errno)); |
| 1077 | #endif /* DEBUG_TTY */ |
| 1078 | return -1; |
| 1079 | } |
| 1080 | el->el_tty.t_mode = EX_IO; |
| 1081 | return 0; |
| 1082 | } |
| 1083 | |
| 1084 | |
| 1085 | /* tty_quotemode(): |
no test coverage detected