Fix for term attrs getting messed up by Fish shell
This commit is contained in:
parent
ff800b2377
commit
8d5e68d444
4
bb.c
4
bb.c
@ -187,9 +187,13 @@ void update_term_size(int sig)
|
|||||||
*/
|
*/
|
||||||
void init_term(void)
|
void init_term(void)
|
||||||
{
|
{
|
||||||
|
static int first_time = 1;
|
||||||
tty_in = fopen("/dev/tty", "r");
|
tty_in = fopen("/dev/tty", "r");
|
||||||
tty_out = fopen("/dev/tty", "w");
|
tty_out = fopen("/dev/tty", "w");
|
||||||
|
if (first_time) {
|
||||||
tcgetattr(fileno(tty_out), &orig_termios);
|
tcgetattr(fileno(tty_out), &orig_termios);
|
||||||
|
first_time = 0;
|
||||||
|
}
|
||||||
memcpy(&bb_termios, &orig_termios, sizeof(bb_termios));
|
memcpy(&bb_termios, &orig_termios, sizeof(bb_termios));
|
||||||
cfmakeraw(&bb_termios);
|
cfmakeraw(&bb_termios);
|
||||||
bb_termios.c_cc[VMIN] = 0;
|
bb_termios.c_cc[VMIN] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user