From 46b83043b6466c7f634efced90da9aace1289782 Mon Sep 17 00:00:00 2001 From: Victor Tran Date: Tue, 7 May 2024 21:34:45 +1000 Subject: [PATCH] Default shell on Linux --- .../theterminal/libtheterminal/terminalprofile.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libtheterminal/com/vicr123/theterminal/libtheterminal/terminalprofile.cpp b/libtheterminal/com/vicr123/theterminal/libtheterminal/terminalprofile.cpp index 0b3dd18..ec6db8b 100644 --- a/libtheterminal/com/vicr123/theterminal/libtheterminal/terminalprofile.cpp +++ b/libtheterminal/com/vicr123/theterminal/libtheterminal/terminalprofile.cpp @@ -3,6 +3,11 @@ #include #include +#ifdef Q_OS_UNIX + #include + #include +#endif + struct TerminalProfilePrivate { QString profileName = "default"; QFont font; @@ -100,7 +105,8 @@ QString TerminalProfile::defaultShell() { #ifdef Q_OS_WIN return QStringLiteral("C:/Windows/System32/powershell.exe"); #else - return "/bin/bash"; + auto passwd = getpwuid(getegid()); + return QString(passwd->pw_shell); #endif } #endif