(self, command, working_directory)
| 35 | self.encoding = get_encoding(command, working_directory) |
| 36 | |
| 37 | def start_execution(self, command, working_directory): |
| 38 | master, slave = pty.openpty() |
| 39 | |
| 40 | env_variables = self.prepare_env_variables() |
| 41 | |
| 42 | self.process = subprocess.Popen(command, |
| 43 | cwd=working_directory, |
| 44 | stdin=slave, |
| 45 | stdout=slave, |
| 46 | stderr=slave, |
| 47 | start_new_session=True, |
| 48 | env=env_variables) |
| 49 | self.pty_slave = slave |
| 50 | self.pty_master = master |
| 51 | |
| 52 | # ONLCR - transform \n to \r\n |
| 53 | _unset_output_flags(self.pty_master, termios.ONLCR) |
| 54 | fcntl.fcntl(self.pty_master, fcntl.F_SETFL, os.O_NONBLOCK) |
| 55 | |
| 56 | def write_to_input(self, value): |
| 57 | if self.is_finished(): |
nothing calls this directly
no test coverage detected