]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix directory navigation in Dolphin::Terminal.
authorRaphael Kubo da Costa <kubito@gmail.com>
Tue, 12 Apr 2011 14:14:25 +0000 (11:14 -0300)
committerRaphael Kubo da Costa <kubito@gmail.com>
Tue, 12 Apr 2011 14:18:22 +0000 (11:18 -0300)
When navigating in Dolphin it attempts to keep any open Terminal (F4)
in sync by changing the directory in the shell.  It does this by
sending a "^C; cd $DIRECTORY" however shells under FreeBSD treat "^C"
as a literal string and not SIGINT.  Fix this by sending SIGINT to the
shell instead of "^C".

It appears Linux does not exhibit this behaviour.

Patch originally written by David Naylor, from the KDE-FreeBSD team.

CCMAIL: naylor.b.david@gmail.com

(cherry picked from commit 5f78219e18073e475ed1f1865a1a2be1fafd60cf)

src/panels/terminal/terminalpanel.cpp

index 61d80cbfa26fb17d0ba403a52f2ab57fbae7b3cc..8977111f8fabcaa7a03a076ba67312370730de98 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "terminalpanel.h"
 
+#include <signal.h>
+
 #include <KPluginLoader>
 #include <KPluginFactory>
 #include <kde_terminal_interface_v2.h>
@@ -113,11 +115,8 @@ void TerminalPanel::sendCdToTerminal(const QString& dir)
         // The TerminalV2 interface does not provide a way to delete the
         // current line before sending a new input. This is mandatory,
         // otherwise sending a 'cd x' to a existing 'rm -rf *' might
-        // result in data loss. As workaround Ctrl+C is send.
-        QString cancel;
-        cancel.append(QChar(3));
-        cancel.append(QChar('c'));
-        m_terminal->sendInput(cancel);
+        // result in data loss. As workaround SIGINT is send.
+        kill(m_terminal->terminalProcessId(), SIGINT);
     }
 
     m_terminal->sendInput("cd " + KShell::quoteArg(dir) + '\n');