From a845caec88556253e309db9fe4d9f3c52d13e5e6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 23 Oct 2010 13:46:37 -0700 Subject: [PATCH] Copy term size to pty only if foreground. --- pym/_emerge/AbstractEbuildProcess.py | 4 +++- pym/_emerge/EbuildFetcher.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index b99f1df8a..46c8f938f 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -164,7 +164,9 @@ class AbstractEbuildProcess(SpawnProcess): self._eerror(textwrap.wrap(msg, 72)) def _pipe(self, fd_pipes): - stdout_pipe = fd_pipes.get(1) + stdout_pipe = None + if not self.background: + stdout_pipe = fd_pipes.get(1) got_pty, master_fd, slave_fd = \ _create_pty_or_pipe(copy_term_size=stdout_pipe) return (master_fd, slave_fd) diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py index 141dc69ea..96f295f3b 100644 --- a/pym/_emerge/EbuildFetcher.py +++ b/pym/_emerge/EbuildFetcher.py @@ -156,7 +156,9 @@ class EbuildFetcher(SpawnProcess): # When the output only goes to a log file, # there's no point in creating a pty. return os.pipe() - stdout_pipe = fd_pipes.get(1) + stdout_pipe = None + if not self.background: + stdout_pipe = fd_pipes.get(1) got_pty, master_fd, slave_fd = \ _create_pty_or_pipe(copy_term_size=stdout_pipe) return (master_fd, slave_fd) -- 2.26.2