3 ** Unix system-dependant routines for editline library.
7 #if defined(HAVE_TCGETATTR)
14 static struct termios old
;
18 (void)tcgetattr(0, &old
);
19 rl_erase
= old
.c_cc
[VERASE
];
20 rl_kill
= old
.c_cc
[VKILL
];
21 rl_eof
= old
.c_cc
[VEOF
];
22 rl_intr
= old
.c_cc
[VINTR
];
23 rl_quit
= old
.c_cc
[VQUIT
];
28 new.c_lflag
&= ~(ECHO
| ICANON
);
29 new.c_iflag
&= ~(ISTRIP
| INPCK
);
32 (void)tcsetattr(0, TCSANOW
, &new);
35 (void)tcsetattr(0, TCSANOW
, &old
);
45 static struct sgttyb old_sgttyb
;
46 static struct tchars old_tchars
;
47 struct sgttyb new_sgttyb
;
48 struct tchars new_tchars
;
51 (void)ioctl(0, TIOCGETP
, &old_sgttyb
);
52 rl_erase
= old_sgttyb
.sg_erase
;
53 rl_kill
= old_sgttyb
.sg_kill
;
55 (void)ioctl(0, TIOCGETC
, &old_tchars
);
56 rl_eof
= old_tchars
.t_eofc
;
57 rl_intr
= old_tchars
.t_intrc
;
58 rl_quit
= old_tchars
.t_quitc
;
60 new_sgttyb
= old_sgttyb
;
61 new_sgttyb
.sg_flags
&= ~ECHO
;
62 new_sgttyb
.sg_flags
|= RAW
;
64 new_sgttyb
.sg_flags
|= PASS8
;
65 #endif /* defined(PASS8) */
66 (void)ioctl(0, TIOCSETP
, &new_sgttyb
);
68 new_tchars
= old_tchars
;
69 new_tchars
.t_intrc
= -1;
70 new_tchars
.t_quitc
= -1;
71 (void)ioctl(0, TIOCSETC
, &new_tchars
);
74 (void)ioctl(0, TIOCSETP
, &old_sgttyb
);
75 (void)ioctl(0, TIOCSETC
, &old_tchars
);
78 #endif /* defined(HAVE_TCGETATTR) */
87 if (stat(path
, &Sb
) >= 0)
88 (void)strcat(p
, S_ISDIR(Sb
.st_mode
) ? "/" : " ");