mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
Use UTF-8 encoding while running commands by default
This fixes issues with /run on Windows which usually manifested as encoding errors. Sample: Error running command: 'charmap' codec can't decode byte 0x9d in position 298: character maps to <undefined>
This commit is contained in:
parent
9023d1bc02
commit
8be1af8721
1 changed files with 2 additions and 2 deletions
|
@ -392,7 +392,7 @@ class Commands:
|
||||||
combined_output = None
|
combined_output = None
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, shell=True
|
args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, shell=True, encoding='utf-8', errors='replace'
|
||||||
)
|
)
|
||||||
combined_output = result.stdout
|
combined_output = result.stdout
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -412,7 +412,7 @@ class Commands:
|
||||||
output=combined_output,
|
output=combined_output,
|
||||||
)
|
)
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def cmd_exit(self, args):
|
def cmd_exit(self, args):
|
||||||
"Exit the application"
|
"Exit the application"
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue