1 /* $Header: /src/pub/tcsh/ed.init.c,v 3.43 2000/11/11 23:03:34 christos Exp $ */
3 * ed.init.c: Editor initializations
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTS_ION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 RCSID("$Id: ed.init.c,v 3.43 2000/11/11 23:03:34 christos Exp $")
46 /* ed.init.c -- init routines for the line editor */
47 /* #define DEBUG_TTY */
49 int Tty_raw_mode = 0; /* Last tty change was to raw mode */
50 int MacroLvl = -1; /* pointer to current macro nesting level; */
52 static int Tty_quote_mode = 0; /* Last tty change was to quote mode */
53 static unsigned char vdisable; /* The value of _POSIX_VDISABLE from
56 int Tty_eight_bit = -1; /* does the tty handle eight bits */
58 extern bool GotTermCaps;
60 static ttydata_t extty, edtty, tstty;
64 #define SHTTY (insource ? OLDSTD : SHIN)
66 #define uc unsigned char
67 static unsigned char ttychars[NN_IO][C_NCC] = {
69 (uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL,
70 (uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH,
71 (uc)CDSWTCH, (uc)CERASE2, (uc)CSTART, (uc)CSTOP,
72 (uc)CWERASE, (uc)CSUSP, (uc)CDSUSP, (uc)CREPRINT,
73 (uc)CDISCARD, (uc)CLNEXT, (uc)CSTATUS, (uc)CPAGE,
74 (uc)CPGOFF, (uc)CKILL2, (uc)CBRK, (uc)CMIN,
78 CINTR, CQUIT, CERASE, CKILL,
79 _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
80 _POSIX_VDISABLE, CERASE2, CSTART, CSTOP,
81 _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
82 CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
83 _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1,
99 check_window_size(force)
107 /* don't want to confuse things here */
109 omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW);
111 (void) sighold(SIG_WINDOW);
114 * From: bret@shark.agps.lanl.gov (Bret Thaeler) Avoid sunview bug, where a
115 * partially hidden window gets a SIG_WINDOW every time the text is
118 if (GetSize(&lins, &cols) || force) {
124 ChangeSize(lins, cols);
128 ChangeSize(lins, cols);
131 (void) sigsetmask(omask); /* can change it again */
133 (void) sigrelse(SIG_WINDOW);
144 /* If we were called as a signal handler, restore it. */
146 sigset(snum, window_change);
147 #endif /* UNRELSIGS */
148 check_window_size(0);
154 #endif /* SIG_WINDOW */
157 ed_set_tty_eight_bit()
159 if (tty_getty(SHTTY, &extty) == -1) {
161 xprintf("ed_set_tty_eight_bit: tty_getty: %s\n", strerror(errno));
162 #endif /* DEBUG_TTY */
165 Tty_eight_bit = tty_geteightbit(&extty);
173 static int havesetup = 0;
174 struct varent *imode;
176 if (havesetup) /* if we have never been called */
179 #if defined(POSIX) && defined(_PC_VDISABLE) && !defined(BSD4_4) && \
180 !defined(WINNT_NATIVE)
184 if ((pcret = fpathconf(SHTTY, _PC_VDISABLE)) == -1L)
185 vdisable = (unsigned char) _POSIX_VDISABLE;
187 vdisable = (unsigned char) pcret;
188 if (vdisable != (unsigned char) _POSIX_VDISABLE && rst != 0)
189 for (rst = 0; rst < C_NCC; rst++) {
190 if (ttychars[ED_IO][rst] == (unsigned char) _POSIX_VDISABLE)
191 ttychars[ED_IO][rst] = vdisable;
192 if (ttychars[EX_IO][rst] == (unsigned char) _POSIX_VDISABLE)
193 ttychars[EX_IO][rst] = vdisable;
196 #else /* ! POSIX || !_PC_VDISABLE || BSD4_4 || WINNT_NATIVE */
197 vdisable = (unsigned char) _POSIX_VDISABLE;
198 #endif /* POSIX && _PC_VDISABLE && !BSD4_4 && !WINNT_NATIVE */
200 if ((imode = adrof(STRinputmode)) != NULL) {
201 if (!Strcmp(*(imode->vec), STRinsert))
202 inputmode = MODE_INSERT;
203 else if (!Strcmp(*(imode->vec), STRoverwrite))
204 inputmode = MODE_REPLACE;
207 inputmode = MODE_INSERT;
213 if (tty_getty(SHTTY, &extty) == -1) {
215 xprintf("ed_Setup: tty_getty: %s\n", strerror(errno));
216 # endif /* DEBUG_TTY */
220 tstty = edtty = extty;
222 T_Speed = tty_getspeed(&extty);
223 T_Tabs = tty_gettabs(&extty);
224 Tty_eight_bit = tty_geteightbit(&extty);
226 # if defined(POSIX) || defined(TERMIO)
227 extty.d_t.c_iflag &= ~ttylist[EX_IO][M_INPUT].t_clrmask;
228 extty.d_t.c_iflag |= ttylist[EX_IO][M_INPUT].t_setmask;
230 extty.d_t.c_oflag &= ~ttylist[EX_IO][M_OUTPUT].t_clrmask;
231 extty.d_t.c_oflag |= ttylist[EX_IO][M_OUTPUT].t_setmask;
233 extty.d_t.c_cflag &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
234 extty.d_t.c_cflag |= ttylist[EX_IO][M_CONTROL].t_setmask;
236 extty.d_t.c_lflag &= ~ttylist[EX_IO][M_LINED].t_clrmask;
237 extty.d_t.c_lflag |= ttylist[EX_IO][M_LINED].t_setmask;
239 # if defined(IRIX3_3) && SYSVREL < 4
240 extty.d_t.c_line = NTTYDISC;
241 # endif /* IRIX3_3 && SYSVREL < 4 */
243 # else /* GSTTY */ /* V7, Berkeley style tty */
245 if (T_Tabs) { /* order of &= and |= is important to XTABS */
246 extty.d_t.sg_flags &= ~(ttylist[EX_IO][M_CONTROL].t_clrmask|XTABS);
247 extty.d_t.sg_flags |= ttylist[EX_IO][M_CONTROL].t_setmask;
250 extty.d_t.sg_flags &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
251 extty.d_t.sg_flags |= (ttylist[EX_IO][M_CONTROL].t_setmask|XTABS);
254 extty.d_lb &= ~ttylist[EX_IO][M_LOCAL].t_clrmask;
255 extty.d_lb |= ttylist[EX_IO][M_LOCAL].t_setmask;
259 * Reset the tty chars to reasonable defaults
260 * If they are disabled, then enable them.
263 if (tty_cooked_mode(&tstty)) {
264 tty_getchar(&tstty, ttychars[TS_IO]);
266 * Don't affect CMIN and CTIME for the editor mode
268 for (rst = 0; rst < C_NCC - 2; rst++)
269 if (ttychars[TS_IO][rst] != vdisable &&
270 ttychars[ED_IO][rst] != vdisable)
271 ttychars[ED_IO][rst] = ttychars[TS_IO][rst];
272 for (rst = 0; rst < C_NCC; rst++)
273 if (ttychars[TS_IO][rst] != vdisable &&
274 ttychars[EX_IO][rst] != vdisable)
275 ttychars[EX_IO][rst] = ttychars[TS_IO][rst];
277 tty_setchar(&extty, ttychars[EX_IO]);
278 if (tty_setty(SHTTY, &extty) == -1) {
280 xprintf("ed_Setup: tty_setty: %s\n", strerror(errno));
281 # endif /* DEBUG_TTY */
286 tty_setchar(&extty, ttychars[EX_IO]);
289 (void) sigset(SIG_WINDOW, window_change); /* for window systems */
291 #else /* WINNT_NATIVE */
294 xprintf("rst received in ed_Setup() %d\n", rst);
296 #endif /* WINNT_NATIVE */
304 ResetInLine(1); /* reset the input pointers */
305 GettingInput = 0; /* just in case */
306 LastKill = KillBuf; /* no kill buffer */
309 CheckMaps(); /* do a little error checking on key maps */
312 if (ed_Setup(0) == -1)
316 * if we have been called before but GotTermCaps isn't set, our TERM has
317 * changed, so get new termcaps and try again
321 GetTermCaps(); /* does the obvious, but gets term type each
325 # if defined(TERMIO) || defined(POSIX)
326 edtty.d_t.c_iflag &= ~ttylist[ED_IO][M_INPUT].t_clrmask;
327 edtty.d_t.c_iflag |= ttylist[ED_IO][M_INPUT].t_setmask;
329 edtty.d_t.c_oflag &= ~ttylist[ED_IO][M_OUTPUT].t_clrmask;
330 edtty.d_t.c_oflag |= ttylist[ED_IO][M_OUTPUT].t_setmask;
332 edtty.d_t.c_cflag &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
333 edtty.d_t.c_cflag |= ttylist[ED_IO][M_CONTROL].t_setmask;
335 edtty.d_t.c_lflag &= ~ttylist[ED_IO][M_LINED].t_clrmask;
336 edtty.d_t.c_lflag |= ttylist[ED_IO][M_LINED].t_setmask;
339 # if defined(IRIX3_3) && SYSVREL < 4
340 edtty.d_t.c_line = NTTYDISC;
341 # endif /* IRIX3_3 && SYSVREL < 4 */
345 if (T_Tabs) { /* order of &= and |= is important to XTABS */
346 edtty.d_t.sg_flags &= ~(ttylist[ED_IO][M_CONTROL].t_clrmask | XTABS);
347 edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask;
350 edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
351 edtty.d_t.sg_flags |= (ttylist[ED_IO][M_CONTROL].t_setmask | XTABS);
354 edtty.d_lb &= ~ttylist[ED_IO][M_LOCAL].t_clrmask;
355 edtty.d_lb |= ttylist[ED_IO][M_LOCAL].t_setmask;
356 # endif /* POSIX || TERMIO */
358 tty_setchar(&edtty, ttychars[ED_IO]);
359 #endif /* WINNT_NATIVE */
363 * Check and re-init the line. set the terminal into 1 char at a time mode.
373 #else /* !WINNT_NATIVE */
375 tty_setdisc(SHTTY, ED_IO);
378 if (tty_getty(SHTTY, &tstty) == -1) {
380 xprintf("Rawmode: tty_getty: %s\n", strerror(errno));
381 # endif /* DEBUG_TTY */
386 * We always keep up with the eight bit setting and the speed of the
387 * tty. But only we only believe changes that are made to cooked mode!
389 # if defined(POSIX) || defined(TERMIO)
390 Tty_eight_bit = tty_geteightbit(&tstty);
391 T_Speed = tty_getspeed(&tstty);
395 * Fix from: Steven (Steve) B. Green <xrsbg@charney.gsfc.nasa.gov>
396 * Speed was not being set up correctly under POSIX.
398 if (tty_getspeed(&extty) != T_Speed || tty_getspeed(&edtty) != T_Speed) {
399 (void) cfsetispeed(&extty.d_t, T_Speed);
400 (void) cfsetospeed(&extty.d_t, T_Speed);
401 (void) cfsetispeed(&edtty.d_t, T_Speed);
402 (void) cfsetospeed(&edtty.d_t, T_Speed);
407 T_Speed = tty_getspeed(&tstty);
408 Tty_eight_bit = tty_geteightbit(&tstty);
410 if (extty.d_t.sg_ispeed != tstty.d_t.sg_ispeed) {
411 extty.d_t.sg_ispeed = tstty.d_t.sg_ispeed;
412 edtty.d_t.sg_ispeed = tstty.d_t.sg_ispeed;
415 if (extty.d_t.sg_ospeed != tstty.d_t.sg_ospeed) {
416 extty.d_t.sg_ospeed = tstty.d_t.sg_ospeed;
417 edtty.d_t.sg_ospeed = tstty.d_t.sg_ospeed;
419 # endif /* POSIX || TERMIO */
421 if (tty_cooked_mode(&tstty)) {
423 * re-test for some things here (like maybe the user typed
426 if (tty_gettabs(&tstty) == 0)
431 # if defined(POSIX) || defined(TERMIO)
432 extty.d_t.c_cflag = tstty.d_t.c_cflag;
433 extty.d_t.c_cflag &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
434 extty.d_t.c_cflag |= ttylist[EX_IO][M_CONTROL].t_setmask;
436 edtty.d_t.c_cflag = tstty.d_t.c_cflag;
437 edtty.d_t.c_cflag &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
438 edtty.d_t.c_cflag |= ttylist[ED_IO][M_CONTROL].t_setmask;
440 extty.d_t.c_lflag = tstty.d_t.c_lflag;
441 extty.d_t.c_lflag &= ~ttylist[EX_IO][M_LINED].t_clrmask;
442 extty.d_t.c_lflag |= ttylist[EX_IO][M_LINED].t_setmask;
444 edtty.d_t.c_lflag = tstty.d_t.c_lflag;
445 edtty.d_t.c_lflag &= ~ttylist[ED_IO][M_LINED].t_clrmask;
446 edtty.d_t.c_lflag |= ttylist[ED_IO][M_LINED].t_setmask;
448 extty.d_t.c_iflag = tstty.d_t.c_iflag;
449 extty.d_t.c_iflag &= ~ttylist[EX_IO][M_INPUT].t_clrmask;
450 extty.d_t.c_iflag |= ttylist[EX_IO][M_INPUT].t_setmask;
452 edtty.d_t.c_iflag = tstty.d_t.c_iflag;
453 edtty.d_t.c_iflag &= ~ttylist[ED_IO][M_INPUT].t_clrmask;
454 edtty.d_t.c_iflag |= ttylist[ED_IO][M_INPUT].t_setmask;
456 extty.d_t.c_oflag = tstty.d_t.c_oflag;
457 extty.d_t.c_oflag &= ~ttylist[EX_IO][M_OUTPUT].t_clrmask;
458 extty.d_t.c_oflag |= ttylist[EX_IO][M_OUTPUT].t_setmask;
460 edtty.d_t.c_oflag = tstty.d_t.c_oflag;
461 edtty.d_t.c_oflag &= ~ttylist[ED_IO][M_OUTPUT].t_clrmask;
462 edtty.d_t.c_oflag |= ttylist[ED_IO][M_OUTPUT].t_setmask;
466 extty.d_t.sg_flags = tstty.d_t.sg_flags;
468 extty.d_t.sg_flags &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
469 extty.d_t.sg_flags |= ttylist[EX_IO][M_CONTROL].t_setmask;
471 if (T_Tabs) /* order of &= and |= is important to XTABS */
472 extty.d_t.sg_flags &= ~XTABS;
474 extty.d_t.sg_flags |= XTABS;
476 extty.d_lb = tstty.d_lb;
477 extty.d_lb &= ~ttylist[EX_IO][M_LOCAL].t_clrmask;
478 extty.d_lb |= ttylist[EX_IO][M_LOCAL].t_setmask;
480 edtty.d_t.sg_flags = extty.d_t.sg_flags;
481 if (T_Tabs) { /* order of &= and |= is important to XTABS */
482 edtty.d_t.sg_flags &=
483 ~(ttylist[ED_IO][M_CONTROL].t_clrmask|XTABS);
484 edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask;
487 edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
488 edtty.d_t.sg_flags |=
489 (ttylist[ED_IO][M_CONTROL].t_setmask|XTABS);
492 edtty.d_lb = tstty.d_lb;
493 edtty.d_lb &= ~ttylist[ED_IO][M_LOCAL].t_clrmask;
494 edtty.d_lb |= ttylist[ED_IO][M_LOCAL].t_setmask;
496 # endif /* TERMIO || POSIX */
502 tty_getchar(&tstty, ttychars[TS_IO]);
504 * Check if the user made any changes.
505 * If he did, then propagate the changes to the
506 * edit and execute data structures.
508 for (i = 0; i < C_NCC; i++)
509 if (ttychars[TS_IO][i] != ttychars[EX_IO][i])
512 if (i != C_NCC || didsetty) {
515 * Propagate changes only to the unprotected chars
516 * that have been modified just now.
518 for (i = 0; i < C_NCC; i++) {
519 if (!((ttylist[ED_IO][M_CHAR].t_setmask & C_SH(i))) &&
520 (ttychars[TS_IO][i] != ttychars[EX_IO][i]))
521 ttychars[ED_IO][i] = ttychars[TS_IO][i];
522 if (ttylist[ED_IO][M_CHAR].t_clrmask & C_SH(i))
523 ttychars[ED_IO][i] = vdisable;
525 tty_setchar(&edtty, ttychars[ED_IO]);
527 for (i = 0; i < C_NCC; i++) {
528 if (!((ttylist[EX_IO][M_CHAR].t_setmask & C_SH(i))) &&
529 (ttychars[TS_IO][i] != ttychars[EX_IO][i]))
530 ttychars[EX_IO][i] = ttychars[TS_IO][i];
531 if (ttylist[EX_IO][M_CHAR].t_clrmask & C_SH(i))
532 ttychars[EX_IO][i] = vdisable;
534 tty_setchar(&extty, ttychars[EX_IO]);
539 if (tty_setty(SHTTY, &edtty) == -1) {
541 xprintf("Rawmode: tty_setty: %s\n", strerror(errno));
542 # endif /* DEBUG_TTY */
545 #endif /* WINNT_NATIVE */
547 flush(); /* flush any buffered output */
553 { /* set tty in normal setup */
557 signalfun_t orig_intr;
560 tty_setdisc(SHTTY, EX_IO);
566 /* hold this for reseting tty */
568 orig_intr = (signalfun_t) signal(SIGINT, SIG_IGN);
572 * sigset doesn't return the previous handler if the signal is held,
573 * it will return SIG_HOLD instead. So instead of restoring the
574 * the signal we would end up installing a blocked SIGINT with a
575 * SIG_IGN signal handler. This is what happened when Cookedmode
576 * was called from sched_run, disabling interrupt for the rest
579 * This is what we do:
580 * - if the signal is blocked, keep it that way
581 * - else set it to SIG_IGN
583 * Casper Dik (casper@fwi.uva.nl)
585 orig_intr = (signalfun_t) sigset(SIGINT, SIG_HOLD);
586 if (orig_intr != SIG_HOLD)
587 (void) sigset(SIGINT, SIG_IGN); /* returns SIG_HOLD */
588 # else /* !SIG_HOLD */
590 * No SIG_HOLD; probably no reliable signals as well.
592 orig_intr = (signalfun_t) sigset(SIGINT, SIG_IGN);
593 # endif /* SIG_HOLD */
594 # endif /* BSDSIGS */
595 if (tty_setty(SHTTY, &extty) == -1) {
597 xprintf("Cookedmode: tty_setty: %s\n", strerror(errno));
598 # endif /* DEBUG_TTY */
602 (void) signal(SIGINT, orig_intr); /* take these again */
604 (void) sigset(SIGINT, orig_intr); /* take these again */
605 # endif /* BSDSIGS */
606 #endif /* WINNT_NATIVE */
616 Cursor = InputBuf; /* reset cursor */
618 InputLim = &InputBuf[INBUFSIZE - 2];
621 CurrentKeyMap = CcKeyMap;
627 LastKill = KillBuf; /* no kill buffer */
629 LastCmd = F_UNASSIGNED; /* previous command executed */
631 MacroLvl = -1; /* no currently active macros */
634 static Char *Input_Line = NULL;
642 * *Everyone* else has an int, but SunOS wants long!
643 * This breaks where int != long (alpha)
649 xfree((ptr_t) Input_Line);
655 #if defined(FIONREAD) && !defined(OREO)
656 (void) ioctl(SHIN, FIONREAD, (ioctl_t) &chrs);
660 chrs = read(SHIN, buf, (size_t) min(chrs, BUFSIZE - 1));
663 Input_Line = Strsave(str2short(buf));
664 PushMacro(Input_Line);
667 /* need to print errno message in case file is migrated */
669 stderror(ERR_SYSTEM, progname, strerror(errno));
672 #endif /* FIONREAD && !OREO */
677 * Bugfix (in Swedish) by:
679 * SICS, PO Box 1263, S-163 13 SPANGA, SWEDEN
680 * {mcvax,munnari,cernvax,diku,inria,prlb2,penet,ukc,unido}!enea!sics.se!jw
681 * Internet: jw@sics.se
683 * (via Hans J Albertsson (thanks))
694 #if defined(TERMIO) || defined(POSIX)
695 qutty.d_t.c_iflag &= ~ttylist[QU_IO][M_INPUT].t_clrmask;
696 qutty.d_t.c_iflag |= ttylist[QU_IO][M_INPUT].t_setmask;
698 qutty.d_t.c_oflag &= ~ttylist[QU_IO][M_OUTPUT].t_clrmask;
699 qutty.d_t.c_oflag |= ttylist[QU_IO][M_OUTPUT].t_setmask;
701 qutty.d_t.c_cflag &= ~ttylist[QU_IO][M_CONTROL].t_clrmask;
702 qutty.d_t.c_cflag |= ttylist[QU_IO][M_CONTROL].t_setmask;
704 qutty.d_t.c_lflag &= ~ttylist[QU_IO][M_LINED].t_clrmask;
705 qutty.d_t.c_lflag |= ttylist[QU_IO][M_LINED].t_setmask;
707 qutty.d_t.sg_flags &= ~ttylist[QU_IO][M_CONTROL].t_clrmask;
708 qutty.d_t.sg_flags |= ttylist[QU_IO][M_CONTROL].t_setmask;
709 qutty.d_lb &= ~ttylist[QU_IO][M_LOCAL].t_clrmask;
710 qutty.d_lb |= ttylist[QU_IO][M_LOCAL].t_setmask;
712 #endif /* TERMIO || POSIX */
713 if (tty_setty(SHTTY, &qutty) == -1) {
715 xprintf("QuoteModeOn: tty_setty: %s\n", strerror(errno));
716 #endif /* DEBUG_TTY */
719 #endif /* !WINNT_NATIVE */
730 if (tty_setty(SHTTY, &edtty) == -1) {
732 xprintf("QuoteModeOff: tty_setty: %s\n", strerror(errno));
733 #endif /* DEBUG_TTY */