- /*
- ** Are we changing the kill or erase character?
- */
- if (killp || erasep) {
- cc_t save_erase, save_kill;
-
- /* get the current terminal attributes */
- tcgetattr(0, &tio);
-
- /* save original kill, erase character for later */
- save_kill = KILL;
- save_erase = ERASE;
-
- /* set new kill, erase character in terminal structure */
- KILL = killp ? chrcnv(killp) : save_kill;
- ERASE = erasep ? chrcnv(erasep) : save_erase;
-
- /* set the new terminal attributes */
- tcsetattr(0, TCSADRAIN, &tio);
-
- /* print out new kill erase characters */
- chrdsp("erase", ERASE);
- chrdsp(", kill", KILL);
- chrdsp(", intr", INTR);
- putchar('\n');
- fflush(stdout);
-
- /*
- ** We set the kill and erase character back to original
- ** setup in terminal structure so we can easily
- ** restore it upon exit.
- */
- KILL = save_kill;
- ERASE = save_erase;
- }
-