4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
40 #pragma ident "%Z%%M% %I% %E% SMI"
44 #include <sys/types.h>
46 #include "curses_inc.h"
49 reset_shell_mode(void)
53 * Restore any virtual terminal setting. This must be done
54 * before the TIOCSETN because DIOCSETT will clobber flags like xtabs.
56 cur_term
-> old
.st_flgs
|= TM_SET
;
57 (void) ioctl(cur_term
->Filedes
, DIOCSETT
, &cur_term
-> old
);
60 if (_BRS(SHELLTTYS
)) {
61 if (shell_istermios
< 0) {
64 SHELLTTY
.c_lflag
= SHELLTTYS
.c_lflag
;
65 SHELLTTY
.c_oflag
= SHELLTTYS
.c_oflag
;
66 SHELLTTY
.c_iflag
= SHELLTTYS
.c_iflag
;
67 SHELLTTY
.c_cflag
= SHELLTTYS
.c_cflag
;
68 for (i
= 0; i
< NCC
; i
++)
69 SHELLTTY
.c_cc
[i
] = SHELLTTYS
.c_cc
[i
];
70 (void) ioctl(cur_term
-> Filedes
, TCSETAW
, &SHELLTTY
);
72 (void) ioctl(cur_term
-> Filedes
, TCSETSW
, &SHELLTTYS
);
74 if (cur_term
-> newlmode
!= cur_term
-> oldlmode
)
75 (void) ioctl(cur_term
-> Filedes
, TIOCLSET
,
76 &cur_term
-> oldlmode
);
81 (void) ioctl(cur_term
-> Filedes
, TIOCSETN
, &SHELLTTY
);
83 if (cur_term
-> newlmode
!= cur_term
-> oldlmode
)
84 (void) ioctl(cur_term
-> Filedes
, TIOCLSET
,
85 &cur_term
-> oldlmode
);