48 #include <sys/types.h> 60 #if defined(HAVE_TCGETATTR) 65 static struct termios old;
69 (void)tcgetattr(0, &old);
79 new.c_lflag &= ~(ECHO | ICANON);
80 new.c_iflag &= ~(ISTRIP | INPCK);
85 new.c_cc[VDSUSP] = -1;
88 (void)tcsetattr(0, TCSANOW, &
new);
91 (
void)tcsetattr(0, TCSANOW, &old);
99 static struct sgttyb old_sgttyb;
100 static struct tchars old_tchars;
101 struct sgttyb new_sgttyb;
102 struct tchars new_tchars;
105 (void)ioctl(0, TIOCGETP, &old_sgttyb);
109 (void)ioctl(0, TIOCGETC, &old_tchars);
110 rl_eof = old_tchars.t_eofc;
114 new_sgttyb = old_sgttyb;
115 new_sgttyb.sg_flags &= ~ECHO;
116 new_sgttyb.sg_flags |= RAW;
118 new_sgttyb.sg_flags |= PASS8;
120 (void)ioctl(0, TIOCSETP, &new_sgttyb);
122 new_tchars = old_tchars;
123 new_tchars.t_intrc = -1;
124 new_tchars.t_quitc = -1;
125 (void)ioctl(0, TIOCSETC, &new_tchars);
128 (void)ioctl(0, TIOCSETP, &old_sgttyb);
129 (void)ioctl(0, TIOCSETC, &old_tchars);
146 s = read(0, &c, (
ESIZE_T)1) == 1 ? c : EOF;
154 if (stat(path, &Sb) >= 0)
155 (void)strcat(p,
S_ISDIR(Sb.st_mode) ?
"/" :
" ");
162 if ((stat(path, &Sb) >= 0) &&
S_ISDIR(Sb.st_mode))
171 kill(getpid(),SIGINT);
void rl_ttyset(int Reset)
int el_is_directory(char *path)
void rl_add_slash(char *path, char *p)