1 /* $Header: /src/pub/tcsh/ed.init.c,v 3.52 2005/01/18 20:24:50 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. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTS_ION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 RCSID("$Id: ed.init.c,v 3.52 2005/01/18 20:24:50 christos Exp $")
41 /* ed.init.c -- init routines for the line editor */
42 /* #define DEBUG_TTY */
44 int Tty_raw_mode = 0; /* Last tty change was to raw mode */
45 int MacroLvl = -1; /* pointer to current macro nesting level; */
47 static int Tty_quote_mode = 0; /* Last tty change was to quote mode */
48 static unsigned char vdisable; /* The value of _POSIX_VDISABLE from
51 int Tty_eight_bit = -1; /* does the tty handle eight bits */
53 extern int GotTermCaps;
55 static ttydata_t extty, edtty, tstty;
58 #define SHTTY (insource ? OLDSTD : SHIN)
60 #define uc unsigned char
61 static unsigned char ttychars[NN_IO][C_NCC] = {
63 (uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL,
64 (uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH,
65 (uc)CDSWTCH, (uc)CERASE2, (uc)CSTART, (uc)CSTOP,
66 (uc)CWERASE, (uc)CSUSP, (uc)CDSUSP, (uc)CREPRINT,
67 (uc)CDISCARD, (uc)CLNEXT, (uc)CSTATUS, (uc)CPAGE,
68 (uc)CPGOFF, (uc)CKILL2, (uc)CBRK, (uc)CMIN,
72 CINTR, CQUIT, CERASE, CKILL,
73 _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
74 _POSIX_VDISABLE, CERASE2, CSTART, CSTOP,
75 _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
76 CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
77 _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1,
93 check_window_size(force)
101 /* don't want to confuse things here */
103 omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW);
105 (void) sighold(SIG_WINDOW);
108 * From: bret@shark.agps.lanl.gov (Bret Thaeler) Avoid sunview bug, where a
109 * partially hidden window gets a SIG_WINDOW every time the text is
112 if (GetSize(&lins, &cols) || force) {
118 ChangeSize(lins, cols);
122 ChangeSize(lins, cols);
125 (void) sigsetmask(omask); /* can change it again */
127 (void) sigrelse(SIG_WINDOW);
139 /* If we were called as a signal handler, restore it. */
141 sigset(snum, window_change);
142 #endif /* UNRELSIGS */
146 #endif /* SIG_WINDOW */
149 ed_set_tty_eight_bit()
151 if (tty_getty(SHTTY, &extty) == -1) {
153 xprintf("ed_set_tty_eight_bit: tty_getty: %s\n", strerror(errno));
154 #endif /* DEBUG_TTY */
157 Tty_eight_bit = tty_geteightbit(&extty);
165 static int havesetup = 0;
166 struct varent *imode;
168 if (havesetup) /* if we have never been called */
171 #if defined(POSIX) && defined(_PC_VDISABLE) && !defined(BSD4_4) && \
172 !defined(WINNT_NATIVE)
176 if ((pcret = fpathconf(SHTTY, _PC_VDISABLE)) == -1L)
177 vdisable = (unsigned char) _POSIX_VDISABLE;
179 vdisable = (unsigned char) pcret;
180 if (vdisable != (unsigned char) _POSIX_VDISABLE && rst != 0)
181 for (rst = 0; rst < C_NCC; rst++) {
182 if (ttychars[ED_IO][rst] == (unsigned char) _POSIX_VDISABLE)
183 ttychars[ED_IO][rst] = vdisable;
184 if (ttychars[EX_IO][rst] == (unsigned char) _POSIX_VDISABLE)
185 ttychars[EX_IO][rst] = vdisable;
188 #else /* ! POSIX || !_PC_VDISABLE || BSD4_4 || WINNT_NATIVE */
189 vdisable = (unsigned char) _POSIX_VDISABLE;
190 #endif /* POSIX && _PC_VDISABLE && !BSD4_4 && !WINNT_NATIVE */
192 if ((imode = adrof(STRinputmode)) != NULL && imode->vec != NULL) {
193 if (!Strcmp(*(imode->vec), STRinsert))
194 inputmode = MODE_INSERT;
195 else if (!Strcmp(*(imode->vec), STRoverwrite))
196 inputmode = MODE_REPLACE;
199 inputmode = MODE_INSERT;
203 SetKillRing(getn(varval(STRkillring)));
206 if (tty_getty(SHTTY, &extty) == -1) {
208 xprintf("ed_Setup: tty_getty: %s\n", strerror(errno));
209 # endif /* DEBUG_TTY */
213 tstty = edtty = extty;
215 T_Speed = tty_getspeed(&extty);
216 T_Tabs = tty_gettabs(&extty);
217 Tty_eight_bit = tty_geteightbit(&extty);
219 # if defined(POSIX) || defined(TERMIO)
220 extty.d_t.c_iflag &= ~ttylist[EX_IO][M_INPUT].t_clrmask;
221 extty.d_t.c_iflag |= ttylist[EX_IO][M_INPUT].t_setmask;
223 extty.d_t.c_oflag &= ~ttylist[EX_IO][M_OUTPUT].t_clrmask;
224 extty.d_t.c_oflag |= ttylist[EX_IO][M_OUTPUT].t_setmask;
226 extty.d_t.c_cflag &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
227 extty.d_t.c_cflag |= ttylist[EX_IO][M_CONTROL].t_setmask;
229 extty.d_t.c_lflag &= ~ttylist[EX_IO][M_LINED].t_clrmask;
230 extty.d_t.c_lflag |= ttylist[EX_IO][M_LINED].t_setmask;
232 # if defined(IRIX3_3) && SYSVREL < 4
233 extty.d_t.c_line = NTTYDISC;
234 # endif /* IRIX3_3 && SYSVREL < 4 */
236 # else /* GSTTY */ /* V7, Berkeley style tty */
238 if (T_Tabs) { /* order of &= and |= is important to XTABS */
239 extty.d_t.sg_flags &= ~(ttylist[EX_IO][M_CONTROL].t_clrmask|XTABS);
240 extty.d_t.sg_flags |= ttylist[EX_IO][M_CONTROL].t_setmask;
243 extty.d_t.sg_flags &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
244 extty.d_t.sg_flags |= (ttylist[EX_IO][M_CONTROL].t_setmask|XTABS);
247 extty.d_lb &= ~ttylist[EX_IO][M_LOCAL].t_clrmask;
248 extty.d_lb |= ttylist[EX_IO][M_LOCAL].t_setmask;
252 * Reset the tty chars to reasonable defaults
253 * If they are disabled, then enable them.
256 if (tty_cooked_mode(&tstty)) {
257 tty_getchar(&tstty, ttychars[TS_IO]);
259 * Don't affect CMIN and CTIME for the editor mode
261 for (rst = 0; rst < C_NCC - 2; rst++)
262 if (ttychars[TS_IO][rst] != vdisable &&
263 ttychars[ED_IO][rst] != vdisable)
264 ttychars[ED_IO][rst] = ttychars[TS_IO][rst];
265 for (rst = 0; rst < C_NCC; rst++)
266 if (ttychars[TS_IO][rst] != vdisable &&
267 ttychars[EX_IO][rst] != vdisable)
268 ttychars[EX_IO][rst] = ttychars[TS_IO][rst];
270 tty_setchar(&extty, ttychars[EX_IO]);
271 if (tty_setty(SHTTY, &extty) == -1) {
273 xprintf("ed_Setup: tty_setty: %s\n", strerror(errno));
274 # endif /* DEBUG_TTY */
279 tty_setchar(&extty, ttychars[EX_IO]);
282 (void) sigset(SIG_WINDOW, window_change); /* for window systems */
284 #else /* WINNT_NATIVE */
287 xprintf("rst received in ed_Setup() %d\n", rst);
289 #endif /* WINNT_NATIVE */
297 ResetInLine(1); /* reset the input pointers */
298 GettingInput = 0; /* just in case */
300 /* XXX This code was here before the kill ring:
301 LastKill = KillBuf; / * no kill buffer * /
302 If there was any reason for that other than to make sure LastKill
303 was initialized, the code below should go in here instead - but
304 it doesn't seem reasonable to lose the entire kill ring (which is
305 "self-initializing") just because you set $term or whatever, so
306 presumably this whole '#ifdef notdef' should just be taken out. */
308 { /* no kill ring - why? */
310 for (i = 0; i < KillRingMax; i++) {
311 if (KillRing[i].buf != NULL)
312 xfree((ptr_t) KillRing[i].buf);
313 KillRing[i].buf = NULL;
316 YankPos = KillPos = 0;
322 CheckMaps(); /* do a little error checking on key maps */
325 if (ed_Setup(0) == -1)
329 * if we have been called before but GotTermCaps isn't set, our TERM has
330 * changed, so get new termcaps and try again
334 GetTermCaps(); /* does the obvious, but gets term type each
338 # if defined(TERMIO) || defined(POSIX)
339 edtty.d_t.c_iflag &= ~ttylist[ED_IO][M_INPUT].t_clrmask;
340 edtty.d_t.c_iflag |= ttylist[ED_IO][M_INPUT].t_setmask;
342 edtty.d_t.c_oflag &= ~ttylist[ED_IO][M_OUTPUT].t_clrmask;
343 edtty.d_t.c_oflag |= ttylist[ED_IO][M_OUTPUT].t_setmask;
345 edtty.d_t.c_cflag &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
346 edtty.d_t.c_cflag |= ttylist[ED_IO][M_CONTROL].t_setmask;
348 edtty.d_t.c_lflag &= ~ttylist[ED_IO][M_LINED].t_clrmask;
349 edtty.d_t.c_lflag |= ttylist[ED_IO][M_LINED].t_setmask;
352 # if defined(IRIX3_3) && SYSVREL < 4
353 edtty.d_t.c_line = NTTYDISC;
354 # endif /* IRIX3_3 && SYSVREL < 4 */
358 if (T_Tabs) { /* order of &= and |= is important to XTABS */
359 edtty.d_t.sg_flags &= ~(ttylist[ED_IO][M_CONTROL].t_clrmask | XTABS);
360 edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask;
363 edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
364 edtty.d_t.sg_flags |= (ttylist[ED_IO][M_CONTROL].t_setmask | XTABS);
367 edtty.d_lb &= ~ttylist[ED_IO][M_LOCAL].t_clrmask;
368 edtty.d_lb |= ttylist[ED_IO][M_LOCAL].t_setmask;
369 # endif /* POSIX || TERMIO */
371 tty_setchar(&edtty, ttychars[ED_IO]);
372 #endif /* WINNT_NATIVE */
376 * Check and re-init the line. set the terminal into 1 char at a time mode.
386 #else /* !WINNT_NATIVE */
388 tty_setdisc(SHTTY, ED_IO);
391 if (tty_getty(SHTTY, &tstty) == -1) {
393 xprintf("Rawmode: tty_getty: %s\n", strerror(errno));
394 # endif /* DEBUG_TTY */
399 * We always keep up with the eight bit setting and the speed of the
400 * tty. But only we only believe changes that are made to cooked mode!
402 # if defined(POSIX) || defined(TERMIO)
403 Tty_eight_bit = tty_geteightbit(&tstty);
404 T_Speed = tty_getspeed(&tstty);
408 * Fix from: Steven (Steve) B. Green <xrsbg@charney.gsfc.nasa.gov>
409 * Speed was not being set up correctly under POSIX.
411 if (tty_getspeed(&extty) != T_Speed || tty_getspeed(&edtty) != T_Speed) {
412 (void) cfsetispeed(&extty.d_t, T_Speed);
413 (void) cfsetospeed(&extty.d_t, T_Speed);
414 (void) cfsetispeed(&edtty.d_t, T_Speed);
415 (void) cfsetospeed(&edtty.d_t, T_Speed);
420 T_Speed = tty_getspeed(&tstty);
421 Tty_eight_bit = tty_geteightbit(&tstty);
423 if (extty.d_t.sg_ispeed != tstty.d_t.sg_ispeed) {
424 extty.d_t.sg_ispeed = tstty.d_t.sg_ispeed;
425 edtty.d_t.sg_ispeed = tstty.d_t.sg_ispeed;
428 if (extty.d_t.sg_ospeed != tstty.d_t.sg_ospeed) {
429 extty.d_t.sg_ospeed = tstty.d_t.sg_ospeed;
430 edtty.d_t.sg_ospeed = tstty.d_t.sg_ospeed;
432 # endif /* POSIX || TERMIO */
434 if (tty_cooked_mode(&tstty)) {
436 * re-test for some things here (like maybe the user typed
439 if (tty_gettabs(&tstty) == 0)
444 # if defined(POSIX) || defined(TERMIO)
445 extty.d_t.c_cflag = tstty.d_t.c_cflag;
446 extty.d_t.c_cflag &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
447 extty.d_t.c_cflag |= ttylist[EX_IO][M_CONTROL].t_setmask;
449 edtty.d_t.c_cflag = tstty.d_t.c_cflag;
450 edtty.d_t.c_cflag &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
451 edtty.d_t.c_cflag |= ttylist[ED_IO][M_CONTROL].t_setmask;
453 extty.d_t.c_lflag = tstty.d_t.c_lflag;
454 extty.d_t.c_lflag &= ~ttylist[EX_IO][M_LINED].t_clrmask;
455 extty.d_t.c_lflag |= ttylist[EX_IO][M_LINED].t_setmask;
457 edtty.d_t.c_lflag = tstty.d_t.c_lflag;
458 edtty.d_t.c_lflag &= ~ttylist[ED_IO][M_LINED].t_clrmask;
459 edtty.d_t.c_lflag |= ttylist[ED_IO][M_LINED].t_setmask;
461 extty.d_t.c_iflag = tstty.d_t.c_iflag;
462 extty.d_t.c_iflag &= ~ttylist[EX_IO][M_INPUT].t_clrmask;
463 extty.d_t.c_iflag |= ttylist[EX_IO][M_INPUT].t_setmask;
465 edtty.d_t.c_iflag = tstty.d_t.c_iflag;
466 edtty.d_t.c_iflag &= ~ttylist[ED_IO][M_INPUT].t_clrmask;
467 edtty.d_t.c_iflag |= ttylist[ED_IO][M_INPUT].t_setmask;
469 extty.d_t.c_oflag = tstty.d_t.c_oflag;
470 extty.d_t.c_oflag &= ~ttylist[EX_IO][M_OUTPUT].t_clrmask;
471 extty.d_t.c_oflag |= ttylist[EX_IO][M_OUTPUT].t_setmask;
473 edtty.d_t.c_oflag = tstty.d_t.c_oflag;
474 edtty.d_t.c_oflag &= ~ttylist[ED_IO][M_OUTPUT].t_clrmask;
475 edtty.d_t.c_oflag |= ttylist[ED_IO][M_OUTPUT].t_setmask;
479 extty.d_t.sg_flags = tstty.d_t.sg_flags;
481 extty.d_t.sg_flags &= ~ttylist[EX_IO][M_CONTROL].t_clrmask;
482 extty.d_t.sg_flags |= ttylist[EX_IO][M_CONTROL].t_setmask;
484 if (T_Tabs) /* order of &= and |= is important to XTABS */
485 extty.d_t.sg_flags &= ~XTABS;
487 extty.d_t.sg_flags |= XTABS;
489 extty.d_lb = tstty.d_lb;
490 extty.d_lb &= ~ttylist[EX_IO][M_LOCAL].t_clrmask;
491 extty.d_lb |= ttylist[EX_IO][M_LOCAL].t_setmask;
493 edtty.d_t.sg_flags = extty.d_t.sg_flags;
494 if (T_Tabs) { /* order of &= and |= is important to XTABS */
495 edtty.d_t.sg_flags &=
496 ~(ttylist[ED_IO][M_CONTROL].t_clrmask|XTABS);
497 edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask;
500 edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
501 edtty.d_t.sg_flags |=
502 (ttylist[ED_IO][M_CONTROL].t_setmask|XTABS);
505 edtty.d_lb = tstty.d_lb;
506 edtty.d_lb &= ~ttylist[ED_IO][M_LOCAL].t_clrmask;
507 edtty.d_lb |= ttylist[ED_IO][M_LOCAL].t_setmask;
509 # endif /* TERMIO || POSIX */
514 tty_getchar(&tstty, ttychars[TS_IO]);
516 * Check if the user made any changes.
517 * If he did, then propagate the changes to the
518 * edit and execute data structures.
520 for (i = 0; i < C_NCC; i++)
521 if (ttychars[TS_IO][i] != ttychars[EX_IO][i])
524 if (i != C_NCC || didsetty) {
527 * Propagate changes only to the unprotected chars
528 * that have been modified just now.
530 for (i = 0; i < C_NCC; i++) {
531 if (!((ttylist[ED_IO][M_CHAR].t_setmask & C_SH(i))) &&
532 (ttychars[TS_IO][i] != ttychars[EX_IO][i]))
533 ttychars[ED_IO][i] = ttychars[TS_IO][i];
534 if (ttylist[ED_IO][M_CHAR].t_clrmask & C_SH(i))
535 ttychars[ED_IO][i] = vdisable;
537 tty_setchar(&edtty, ttychars[ED_IO]);
539 for (i = 0; i < C_NCC; i++) {
540 if (!((ttylist[EX_IO][M_CHAR].t_setmask & C_SH(i))) &&
541 (ttychars[TS_IO][i] != ttychars[EX_IO][i]))
542 ttychars[EX_IO][i] = ttychars[TS_IO][i];
543 if (ttylist[EX_IO][M_CHAR].t_clrmask & C_SH(i))
544 ttychars[EX_IO][i] = vdisable;
546 tty_setchar(&extty, ttychars[EX_IO]);
551 if (tty_setty(SHTTY, &edtty) == -1) {
553 xprintf("Rawmode: tty_setty: %s\n", strerror(errno));
554 # endif /* DEBUG_TTY */
557 #endif /* WINNT_NATIVE */
559 flush(); /* flush any buffered output */
565 { /* set tty in normal setup */
569 signalfun_t orig_intr;
572 tty_setdisc(SHTTY, EX_IO);
578 /* hold this for reseting tty */
580 orig_intr = (signalfun_t) signal(SIGINT, SIG_IGN);
584 * sigset doesn't return the previous handler if the signal is held,
585 * it will return SIG_HOLD instead. So instead of restoring the
586 * the signal we would end up installing a blocked SIGINT with a
587 * SIG_IGN signal handler. This is what happened when Cookedmode
588 * was called from sched_run, disabling interrupt for the rest
591 * This is what we do:
592 * - if the signal is blocked, keep it that way
593 * - else set it to SIG_IGN
595 * Casper Dik (casper@fwi.uva.nl)
597 orig_intr = (signalfun_t) sigset(SIGINT, SIG_HOLD);
598 if (orig_intr != SIG_HOLD)
599 (void) sigset(SIGINT, SIG_IGN); /* returns SIG_HOLD */
600 # else /* !SIG_HOLD */
602 * No SIG_HOLD; probably no reliable signals as well.
604 orig_intr = (signalfun_t) sigset(SIGINT, SIG_IGN);
605 # endif /* SIG_HOLD */
606 # endif /* BSDSIGS */
607 if (tty_setty(SHTTY, &extty) == -1) {
609 xprintf("Cookedmode: tty_setty: %s\n", strerror(errno));
610 # endif /* DEBUG_TTY */
614 (void) signal(SIGINT, orig_intr); /* take these again */
616 (void) sigset(SIGINT, orig_intr); /* take these again */
617 # endif /* BSDSIGS */
618 #endif /* WINNT_NATIVE */
628 Cursor = InputBuf; /* reset cursor */
630 InputLim = &InputBuf[INBUFSIZE - 2];
633 CurrentKeyMap = CcKeyMap;
638 LastCmd = F_UNASSIGNED; /* previous command executed */
640 MacroLvl = -1; /* no currently active macros */
643 static Char *Input_Line = NULL;
651 * *Everyone* else has an int, but SunOS wants long!
652 * This breaks where int != long (alpha)
658 xfree((ptr_t) Input_Line);
664 #if defined(FIONREAD) && !defined(OREO)
665 (void) ioctl(SHIN, FIONREAD, (ioctl_t) &chrs);
669 chrs = read(SHIN, buf, (size_t) min(chrs, BUFSIZE - 1));
672 Input_Line = Strsave(str2short(buf));
673 PushMacro(Input_Line);
676 /* need to print errno message in case file is migrated */
678 stderror(ERR_SYSTEM, progname, strerror(errno));
681 #endif /* FIONREAD && !OREO */
686 * Bugfix (in Swedish) by:
688 * SICS, PO Box 1263, S-163 13 SPANGA, SWEDEN
689 * {mcvax,munnari,cernvax,diku,inria,prlb2,penet,ukc,unido}!enea!sics.se!jw
690 * Internet: jw@sics.se
692 * (via Hans J Albertsson (thanks))
703 #if defined(TERMIO) || defined(POSIX)
704 qutty.d_t.c_iflag &= ~ttylist[QU_IO][M_INPUT].t_clrmask;
705 qutty.d_t.c_iflag |= ttylist[QU_IO][M_INPUT].t_setmask;
707 qutty.d_t.c_oflag &= ~ttylist[QU_IO][M_OUTPUT].t_clrmask;
708 qutty.d_t.c_oflag |= ttylist[QU_IO][M_OUTPUT].t_setmask;
710 qutty.d_t.c_cflag &= ~ttylist[QU_IO][M_CONTROL].t_clrmask;
711 qutty.d_t.c_cflag |= ttylist[QU_IO][M_CONTROL].t_setmask;
713 qutty.d_t.c_lflag &= ~ttylist[QU_IO][M_LINED].t_clrmask;
714 qutty.d_t.c_lflag |= ttylist[QU_IO][M_LINED].t_setmask;
716 qutty.d_t.sg_flags &= ~ttylist[QU_IO][M_CONTROL].t_clrmask;
717 qutty.d_t.sg_flags |= ttylist[QU_IO][M_CONTROL].t_setmask;
718 qutty.d_lb &= ~ttylist[QU_IO][M_LOCAL].t_clrmask;
719 qutty.d_lb |= ttylist[QU_IO][M_LOCAL].t_setmask;
721 #endif /* TERMIO || POSIX */
722 if (tty_setty(SHTTY, &qutty) == -1) {
724 xprintf("QuoteModeOn: tty_setty: %s\n", strerror(errno));
725 #endif /* DEBUG_TTY */
728 #endif /* !WINNT_NATIVE */
739 if (tty_setty(SHTTY, &edtty) == -1) {
741 xprintf("QuoteModeOff: tty_setty: %s\n", strerror(errno));
742 #endif /* DEBUG_TTY */