'Send a command, followed by a command to echo a sentinel,
and return without waiting for the command to complete.
args: command and arguments, or string
printPid: print command\'s PID? (False)'

def sendCmd(self, *args, **kwargs):

    assert (self.shell and (not self.waiting))
    printPid = kwargs.get('printPid', False)
    if ((len(args) == 1) and isinstance(args[0], list)):
        cmd = args[0]
    elif (len(args) > 0):
        cmd = args
    if (not isinstance(cmd, str)):
        cmd = '    '.join([str(c) for c in cmd])
    if (not re.search('\\w', cmd)):
        cmd = 'echo    -n'
    self.lastCmd = cmd
    if ((len(cmd) > 0) and (cmd[(-1)] == '&')):
        cmd += '    printf    "\\001%d\\012"    $!    '
    elif (printPid and (not isShellBuiltin(cmd))):
        cmd = ('mnexec    -p    ' + cmd)
    self.write((cmd + '\n'))
    self.lastPid = None
    self.waiting = True
