MCPcopy Create free account
hub / github.com/bugy/script-server / start_execution

Method start_execution

src/execution/process_pty.py:37–54  ·  view source on GitHub ↗
(self, command, working_directory)

Source from the content-addressed store, hash-verified

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():

Callers

nothing calls this directly

Calls 2

_unset_output_flagsFunction · 0.85
prepare_env_variablesMethod · 0.80

Tested by

no test coverage detected