1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| | --- a/src/shell_manager.cc
+++ b/src/shell_manager.cc
@@ -22,30 +22,7 @@
ShellManager::ShellManager()
{
- // Get a guaranteed to be POSIX shell binary
- {
- auto size = confstr(_CS_PATH, 0, 0);
- String path; path.resize(size-1, 0);
- confstr(_CS_PATH, path.data(), size);
- for (auto dir : StringView{path} | split<StringView>(':'))
- {
- String candidate = format("{}/sh", dir);
- struct stat st;
- if (stat(candidate.c_str(), &st))
- continue;
-
- bool executable = (st.st_mode & S_IXUSR)
- | (st.st_mode & S_IXGRP)
- | (st.st_mode & S_IXOTH);
- if (S_ISREG(st.st_mode) and executable)
- {
- m_shell = std::move(candidate);
- break;
- }
- }
- if (m_shell.empty())
- throw runtime_error{format("unable to find a posix shell in {}", path)};
- }
+ m_shell = "__BASH_PATH__/bin/sh";
// Add Kakoune binary location to the path to guarantee that %sh{ ... }
// have access to the kak command regardless of if the user installed it
|