Respect --encoding instead of defaulting to UTF-8 when running commands with /run

This commit is contained in:
Christopher Toth 2023-12-29 13:40:33 -05:00
parent 8be1af8721
commit 5f65d5d036

View file

@ -392,7 +392,7 @@ class Commands:
combined_output = None
try:
result = subprocess.run(
args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, shell=True, encoding='utf-8', errors='replace'
args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, shell=True, encoding=self.io.encoding, errors='replace'
)
combined_output = result.stdout
except Exception as e:
@ -412,7 +412,7 @@ class Commands:
output=combined_output,
)
return msg
def cmd_exit(self, args):
"Exit the application"
sys.exit()