Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit 9c767fa

Browse files
Use bash to locate executables [fixes #8 fixes #14]
1 parent 1f4e10d commit 9c767fa

4 files changed

Lines changed: 15 additions & 1 deletion

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"search_in_project_shell": "/bin/bash"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"search_in_project_shell": "/bin/bash"
3+
}

SearchInProject.sublime-settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
/* and git grep is also faster, but only works inside a Git repository */
99
"search_in_project_engine": "grep",
1010

11+
/* What shell to use to run the command. Uses bash by default on Linux/OSX, and cmd on Windows */
12+
/* "search_in_project_shell": "/path/to/your/shell", */
13+
1114
/* Grep configuration */
1215
/* Path to grep executable; if the standard one doesn't work for you, you can specify an explicit path in your user config file. */
1316
"search_in_project_Grep_path_to_executable": "grep",

searchengines/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ def run(self, query, folders):
3333
"""
3434
command_line = self._command_line(query, folders)
3535
print("Running: %s" % command_line)
36-
pipe = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE)
36+
pipe = subprocess.Popen(command_line,
37+
shell=True,
38+
executable=self.settings.get('search_in_project_shell', None),
39+
stdout=subprocess.PIPE,
40+
stderr=subprocess.PIPE
41+
)
3742
output, error = pipe.communicate()
3843
if pipe.returncode != 0:
3944
return None

0 commit comments

Comments
 (0)