* Get initial state of terminal, set ospeed (for termcap routines) * and switch off tab expansion if necessary. * Called by startup() in termcap.c and after returning from ! or ^Z */
| 208 | * Called by startup() in termcap.c and after returning from ! or ^Z |
| 209 | */ |
| 210 | void |
| 211 | gettty(void) |
| 212 | { |
| 213 | if (GTTY(&inittyb) < 0 || GTTY2(&inittyb2) < 0) |
| 214 | perror("NetHack (gettty)"); |
| 215 | curttyb = inittyb; |
| 216 | curttyb2 = inittyb2; |
| 217 | ospeed = OSPEED(inittyb); |
| 218 | erase_char = inittyb.erase_sym; |
| 219 | kill_char = inittyb.kill_sym; |
| 220 | intr_char = inittyb2.intr_sym; |
| 221 | getioctls(); |
| 222 | |
| 223 | /* do not expand tabs - they might be needed inside a cm sequence */ |
| 224 | if (curttyb.tabflgs & EXTABS) { |
| 225 | curttyb.tabflgs &= ~EXTABS; |
| 226 | setctty(); |
| 227 | } |
| 228 | settty_needed = TRUE; |
| 229 | } |
| 230 | |
| 231 | /* reset terminal to original state */ |
| 232 | void |