mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
fix: properly quote filenames with spaces and special characters using shlex.quote()
This commit is contained in:
parent
c4e766a4c4
commit
36bc8f90db
1 changed files with 2 additions and 3 deletions
|
@ -3,6 +3,7 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import shlex
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
@ -575,9 +576,7 @@ class Commands:
|
||||||
self.io.print(diff)
|
self.io.print(diff)
|
||||||
|
|
||||||
def quote_fname(self, fname):
|
def quote_fname(self, fname):
|
||||||
if " " in fname and '"' not in fname:
|
return shlex.quote(fname)
|
||||||
fname = f'"{fname}"'
|
|
||||||
return fname
|
|
||||||
|
|
||||||
def completions_raw_read_only(self, document, complete_event):
|
def completions_raw_read_only(self, document, complete_event):
|
||||||
# Get the text before the cursor and strip leading spaces
|
# Get the text before the cursor and strip leading spaces
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue