MCPcopy Create free account
hub / github.com/NetHack/NetHack / gettty

Function gettty

sys/share/unixtty.c:210–229  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

208 * Called by startup() in termcap.c and after returning from ! or ^Z
209 */
210void
211gettty(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 */
232void

Callers

nothing calls this directly

Calls 2

getioctlsFunction · 0.85
setcttyFunction · 0.70

Tested by

no test coverage detected