# Buggy code
def __init__(self, specs, procs, starttime=None, captured=False):
    """
    Parameters
    ----------
    specs : list of SubprocSpec
        Process sepcifications
    procs : list of Popen-like
        Process objects.
    starttime : floats or None, optional
        Start timestamp.
    captured : bool or str, optional
        Flag for whether or not the command should be captured.

    Attributes
    ----------
    spec : SubprocSpec
        The last specification in specs
    proc : Popen-like
        The process in procs
    ended : bool
        Boolean for if the command has stopped executing.
    input : str
        A string of the standard input.
    output : str
        A string of the standard output.
    errors : str
        A string of the standard error.
    lines : list of str
        The output lines
    """
    self.procs = procs
    self.proc = procs[-1]
    self.specs = specs
    self.spec = specs[-1]
    self.starttime = starttime or time.time()
    self.captured = captured
    self.ended = False
    self.input = self._output = self.errors = self.endtime = None
    self._closed_handle_cache = {}
    self.lines = []
    self._stderr_prefix = self._stderr_postfix = None


# Traceback (ProcessLookupError)
ls | more
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 17380, in default
run_compiled_code(code, self.ctx, None, 'single')
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 1964, in run_compiled_code
func(code, glb, loc)
File "<xonsh-code>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 16159, in subproc_captured_hiddenobject
return run_subproc(cmds, captured='hiddenobject')
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 16127, in run_subproc
command.end()
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 11116, in end
for _ in self.tee_stdout():
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 11041, in tee_stdout
for line in self.iterraw():
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 10940, in iterraw
wait_for_active_job()
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 3694, in wait_for_active_job
_continue(active_task)
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 3607, in _continue
_send_signal(job, signal.SIGCONT)
File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 3542, in _send_signal
os.kill(pid, signal)
ProcessLookupError: [Errno 3] No such process

# Fixed code
def __init__(self, specs):
    """
    Parameters
    ----------
    specs : list of SubprocSpec
        Process sepcifications

    Attributes
    ----------
    spec : SubprocSpec
        The last specification in specs
    proc : Popen-like
        The process in procs
    ended : bool
        Boolean for if the command has stopped executing.
    input : str
        A string of the standard input.
    output : str
        A string of the standard output.
    errors : str
        A string of the standard error.
    lines : list of str
        The output lines
    starttime : floats or None
        Pipeline start timestamp.
    """
    self.starttime = None
    self.ended = False
    self.procs = []
    self.specs = specs
    self.spec = specs[-1]
    self.captured = specs[-1].captured
    self.input = self._output = self.errors = self.endtime = None
    self._closed_handle_cache = {}
    self.lines = []
    self._stderr_prefix = self._stderr_postfix = None
    self.term_pgid = None

    background = self.spec.background
    pipeline_group = None
    for spec in specs:
        if self.starttime is None:
            self.starttime = time.time()
        try:
            proc = spec.run(pipeline_group=pipeline_group)
        except XonshError:
            self._return_terminal()
            raise
        if (
            proc.pid
            and pipeline_group is None
            and not spec.is_proxy
            and self.captured != "object"
        ):
            pipeline_group = proc.pid
            if update_fg_process_group(pipeline_group, background):
                self.term_pgid = pipeline_group
        self.procs.append(proc)
    self.proc = self.procs[-1]