diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-06-17 14:52:38 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-06-17 14:52:38 -0700 |
| commit | 8d5e68d4441228b0c101940a9b7189938e755130 (patch) | |
| tree | ec2c60a8ec38c24f036617d5c069b624fe50a882 | |
| parent | ff800b2377883f9df5b73cd5a4bb9e98141d835e (diff) | |
Fix for term attrs getting messed up by Fish shell
| -rw-r--r-- | bb.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -187,9 +187,13 @@ void update_term_size(int sig) */ void init_term(void) { + static int first_time = 1; tty_in = fopen("/dev/tty", "r"); tty_out = fopen("/dev/tty", "w"); - tcgetattr(fileno(tty_out), &orig_termios); + if (first_time) { + tcgetattr(fileno(tty_out), &orig_termios); + first_time = 0; + } memcpy(&bb_termios, &orig_termios, sizeof(bb_termios)); cfmakeraw(&bb_termios); bb_termios.c_cc[VMIN] = 0; |
