mirror of
https://github.com/sheumann/hush.git
synced 2024-08-20 04:28:57 +00:00
Adjust the termio settings, and don't use octal since it
is impossible to read by mere mortals. -Erik
This commit is contained in:
parent
531bcb6826
commit
6c41c44898
18
init.c
18
init.c
@ -191,23 +191,25 @@ void message(int device, char *fmt, ...)
|
|||||||
void set_term(int fd)
|
void set_term(int fd)
|
||||||
{
|
{
|
||||||
struct termios tty;
|
struct termios tty;
|
||||||
static const char control_characters[] = {
|
|
||||||
'\003', '\034', '\177', '\025', '\004', '\0',
|
|
||||||
'\1', '\0', '\021', '\023', '\032', '\0', '\022',
|
|
||||||
'\017', '\027', '\026', '\0'
|
|
||||||
};
|
|
||||||
|
|
||||||
tcgetattr(fd, &tty);
|
tcgetattr(fd, &tty);
|
||||||
|
|
||||||
/* set control chars */
|
/* set control chars */
|
||||||
memcpy(tty.c_cc, control_characters, sizeof(control_characters));
|
tty.c_cc[VINTR] = 3; /* C-c */
|
||||||
|
tty.c_cc[VQUIT] = 28; /* C-\ */
|
||||||
|
tty.c_cc[VERASE] = 127; /* C-? */
|
||||||
|
tty.c_cc[VKILL] = 21; /* C-u */
|
||||||
|
tty.c_cc[VEOF] = 4; /* C-d */
|
||||||
|
tty.c_cc[VSTART] = 17; /* C-q */
|
||||||
|
tty.c_cc[VSTOP] = 19; /* C-s */
|
||||||
|
tty.c_cc[VSUSP] = 26; /* C-z */
|
||||||
|
|
||||||
/* use line dicipline 0 */
|
/* use line dicipline 0 */
|
||||||
tty.c_line = 0;
|
tty.c_line = 0;
|
||||||
|
|
||||||
/* Make it be sane */
|
/* Make it be sane */
|
||||||
//tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD;
|
tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD;
|
||||||
//tty.c_cflag |= HUPCL|CLOCAL;
|
tty.c_cflag |= HUPCL|CLOCAL;
|
||||||
|
|
||||||
/* input modes */
|
/* input modes */
|
||||||
tty.c_iflag = ICRNL | IXON | IXOFF;
|
tty.c_iflag = ICRNL | IXON | IXOFF;
|
||||||
|
18
init/init.c
18
init/init.c
@ -191,23 +191,25 @@ void message(int device, char *fmt, ...)
|
|||||||
void set_term(int fd)
|
void set_term(int fd)
|
||||||
{
|
{
|
||||||
struct termios tty;
|
struct termios tty;
|
||||||
static const char control_characters[] = {
|
|
||||||
'\003', '\034', '\177', '\025', '\004', '\0',
|
|
||||||
'\1', '\0', '\021', '\023', '\032', '\0', '\022',
|
|
||||||
'\017', '\027', '\026', '\0'
|
|
||||||
};
|
|
||||||
|
|
||||||
tcgetattr(fd, &tty);
|
tcgetattr(fd, &tty);
|
||||||
|
|
||||||
/* set control chars */
|
/* set control chars */
|
||||||
memcpy(tty.c_cc, control_characters, sizeof(control_characters));
|
tty.c_cc[VINTR] = 3; /* C-c */
|
||||||
|
tty.c_cc[VQUIT] = 28; /* C-\ */
|
||||||
|
tty.c_cc[VERASE] = 127; /* C-? */
|
||||||
|
tty.c_cc[VKILL] = 21; /* C-u */
|
||||||
|
tty.c_cc[VEOF] = 4; /* C-d */
|
||||||
|
tty.c_cc[VSTART] = 17; /* C-q */
|
||||||
|
tty.c_cc[VSTOP] = 19; /* C-s */
|
||||||
|
tty.c_cc[VSUSP] = 26; /* C-z */
|
||||||
|
|
||||||
/* use line dicipline 0 */
|
/* use line dicipline 0 */
|
||||||
tty.c_line = 0;
|
tty.c_line = 0;
|
||||||
|
|
||||||
/* Make it be sane */
|
/* Make it be sane */
|
||||||
//tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD;
|
tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD;
|
||||||
//tty.c_cflag |= HUPCL|CLOCAL;
|
tty.c_cflag |= HUPCL|CLOCAL;
|
||||||
|
|
||||||
/* input modes */
|
/* input modes */
|
||||||
tty.c_iflag = ICRNL | IXON | IXOFF;
|
tty.c_iflag = ICRNL | IXON | IXOFF;
|
||||||
|
Loading…
Reference in New Issue
Block a user