summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/consoleconfigwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/consoleconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/consoleconfigwidget.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/consoleconfigwidget.cpp b/noncore/apps/opie-console/consoleconfigwidget.cpp
index 3f2d154..faedc58 100644
--- a/noncore/apps/opie-console/consoleconfigwidget.cpp
+++ b/noncore/apps/opie-console/consoleconfigwidget.cpp
@@ -10,2 +10,6 @@
+#include <pwd.h>
+#include <sys/types.h>
+
+
#include "consoleconfigwidget.h"
@@ -67,7 +71,14 @@ void ConsoleConfigWidget::load( const Profile& prof ) {
/*
- * we will use /bin/bash as default
- * but will fallback in MyPty to /bin/sh
- * if necessary
+ * default to the users default shell
*/
- m_cmd->setText(prof.readEntry("Command", "/bin/bash"));
+ struct passwd *ent = 0;
+ char *shell = "/bin/sh";
+
+ while ( (ent = getpwent()) != 0 ) {
+ if (ent->pw_shell != "") {
+ shell = ent->pw_shell;
+ }
+ }
+
+ m_cmd->setText(prof.readEntry("Command", shell ));
int envcount = prof.readNumEntry("EnvVars", 0);