Skip to content

Commit 32c1c80

Browse files
committed
Inherit the entire login shell environment on macOS, not just PATH.
1 parent ad8f570 commit 32c1c80

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/textadept_qt.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,9 @@ class Application : public SingleApplication {
733733
// Read $PATH from shell since macOS GUI apps run in a limited environment.
734734
QProcess p;
735735
p.startCommand(qgetenv("SHELL") + " -l -c env"), p.waitForFinished();
736-
QRegularExpression re{"^PATH=(.+)$", QRegularExpression::MultilineOption};
737-
if (auto m = re.match(p.readAll()); m.hasMatch()) qputenv("PATH", m.captured(1).toLocal8Bit());
736+
QRegularExpression re{"^([^=]+)=(.+)$", QRegularExpression::MultilineOption};
737+
for (const auto &match : re.globalMatch(p.readAll()))
738+
qputenv(match.captured(1).toLocal8Bit(), match.captured(2).toLocal8Bit());
738739
#endif
739740
connect(this, &SingleApplication::receivedMessage, this, [](quint32, QByteArray message) {
740741
ta->window()->activateWindow();

0 commit comments

Comments
 (0)