diff --git a/modules/gui/src/python_shell/completer_base.cc b/modules/gui/src/python_shell/completer_base.cc
index 03c574c6df729da39be9f45c5f81037f80c9bc99..3194eb53ca8914caf73e3677a61535fa748bd2b2 100644
--- a/modules/gui/src/python_shell/completer_base.cc
+++ b/modules/gui/src/python_shell/completer_base.cc
@@ -71,7 +71,7 @@ QString OstCompleterBase::GetCommonMatch()
   }
   QStringList matches;
   for(int i=0;i<completionCount();++i){
-  setCurrentRow(i);
+    setCurrentRow(i);
     matches.append(currentCompletion().remove(0,completionPrefix().length()));
   }
   QString common_match;
diff --git a/modules/gui/src/python_shell/python_shell_widget.cc b/modules/gui/src/python_shell/python_shell_widget.cc
index 3462ffc872732a5a2546bcb945555f4272d4e192..f86d0fc538c94591fea9d9dccad96e6aeb78eb3e 100644
--- a/modules/gui/src/python_shell/python_shell_widget.cc
+++ b/modules/gui/src/python_shell/python_shell_widget.cc
@@ -100,7 +100,7 @@ PythonShellWidget::PythonShellWidget(QWidget* parent):
           SLOT(SetCompletionPrefix(const QString&)));
   path_completer_->setWidget(viewport());
   connect(path_completer_,SIGNAL(activated(const QString&)),this, 
-          SLOT(InsertCompletion(const QString&)));
+          SLOT(InsertPathCompletion(const QString&)));
   connect(path_completer_,SIGNAL(recomplete(const QString&)),this, 
           SLOT(Recomplete(const QString&)));
   connect(this,SIGNAL(RequestPathCompletion(const QRect&,bool)),path_completer_, 
@@ -361,6 +361,13 @@ void  PythonShellWidget::InsertCompletion(const QString& completion)
   tc.insertText(completion);
   setTextCursor(tc);
 }
+void  PythonShellWidget::InsertPathCompletion(const QString& completion)
+{
+  InsertCompletion(completion);
+  if(QFileInfo(completion).isDir()){
+    textCursor().insertText(QDir::separator());
+  }
+}
 
 
 void PythonShellWidget::AppendOutput(unsigned int id,const QString& output)
diff --git a/modules/gui/src/python_shell/python_shell_widget.hh b/modules/gui/src/python_shell/python_shell_widget.hh
index 2332799822cd1e9a9a00d87a79d8d5a178969cf6..3bcb20f77191ebd52a4bbc671584c64a41bc8c77 100644
--- a/modules/gui/src/python_shell/python_shell_widget.hh
+++ b/modules/gui/src/python_shell/python_shell_widget.hh
@@ -67,6 +67,7 @@ signals:
 
 public slots:
   void InsertCompletion(const QString& completion);
+  void InsertPathCompletion(const QString& completion);
   void AppendOutput(unsigned int id,const QString& output);
   void AppendError(unsigned int id,const QString& output);
   void OutputFinished(unsigned int id, bool error);