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) (ignore 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
@@ -8,6 +8,10 @@
#include <qregexp.h>
#include <stdio.h>
+#include <pwd.h>
+#include <sys/types.h>
+
+
#include "consoleconfigwidget.h"
ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent,
@@ -65,11 +69,18 @@ ConsoleConfigWidget::~ConsoleConfigWidget() {
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);
for (int i=0; i<envcount; i++) {
QString name = prof.readEntry("Env_Name_" + QString::number(i), "");