Skip to content

Commit

Permalink
Initialize windows size
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Dec 18, 2017
1 parent b553956 commit d946e4c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pts.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ static void *watch_sigwinch(void *data) {
sigaddset(&winch, SIGWINCH);

do {
// Wait for a SIGWINCH
sigwait(&winch, &sig);

if (closing_time) break;

// Get the new terminal size
Expand All @@ -221,7 +218,7 @@ static void *watch_sigwinch(void *data) {
// Set the new terminal size
ioctl(slave, TIOCSWINSZ, &w);

} while (1);
} while (sigwait(&winch, &sig) == 0);

free(data);
return NULL;
Expand Down Expand Up @@ -276,8 +273,6 @@ int watch_sigwinch_async(int master, int slave) {
return -1;
}

// Set the initial terminal size
raise(SIGWINCH);
return 0;
}

Expand Down

0 comments on commit d946e4c

Please sign in to comment.