Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/general.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index 174acb8a..cf925de3 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -352,7 +352,6 @@ class SysCommandWorker:
# only way to get the traceback without loosing it.
self.pid, self.child_fd = pty.fork()
- os.chdir(old_dir)
# https://stackoverflow.com/questions/4022600/python-pty-fork-how-does-it-work
if not self.pid:
@@ -371,6 +370,9 @@ class SysCommandWorker:
log(f"{self.cmd[0]} does not exist.", level=logging.ERROR, fg="red")
self.exit_code = 1
return False
+ else:
+ # Only parent process moves back to the original working directory
+ os.chdir(old_dir)
self.started = time.time()
self.poll_object.register(self.child_fd, EPOLLIN | EPOLLHUP)
@@ -457,7 +459,14 @@ class SysCommand:
if self.session:
return self.session
- with SysCommandWorker(self.cmd, callbacks=self._callbacks, peak_output=self.peak_output, environment_vars=self.environment_vars, remove_vt100_escape_codes_from_lines=self.remove_vt100_escape_codes_from_lines) as session:
+ with SysCommandWorker(
+ self.cmd,
+ callbacks=self._callbacks,
+ peak_output=self.peak_output,
+ environment_vars=self.environment_vars,
+ remove_vt100_escape_codes_from_lines=self.remove_vt100_escape_codes_from_lines,
+ working_directory=self.working_directory) as session:
+
if not self.session:
self.session = session