mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 15:14:44 +00:00
only call ioctl to export new termsize if process is in the foreground
Closes #4477.
This commit is contained in:
parent
720f4ad742
commit
216c4b811a
1 changed files with 4 additions and 1 deletions
|
@ -1592,7 +1592,10 @@ static void export_new_termsize(struct winsize *new_termsize) {
|
|||
env_set_one(L"LINES", ENV_GLOBAL | (lines.missing_or_empty() ? ENV_DEFAULT : ENV_EXPORT), buf);
|
||||
|
||||
#ifdef HAVE_WINSIZE
|
||||
ioctl(STDOUT_FILENO, TIOCSWINSZ, new_termsize);
|
||||
// Only write the new terminal size if we are in the foreground (#4477)
|
||||
if (tcgetpgrp(STDOUT_FILENO) == getpgrp()) {
|
||||
ioctl(STDOUT_FILENO, TIOCSWINSZ, new_termsize);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue