Summary: | RFE - Add ability to send commands to Konsole via D-BUS | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Oleg Atamanenko <oleg.atamanenko+kde> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | adaptee, atkin901 |
Priority: | NOR | ||
Version: | 2.7.1 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.9.0 | |
Sentry Crash Report: |
Description
Oleg Atamanenko
2011-10-10 16:44:35 UTC
You can send a command and have it execute, but it needs to use the correct character from your terminfo, not \n or \r\n. Most likely this is '^M' in your case, so the following shell function will send a command to a session sendtab () { sessionno=$1 cmd=$2 session="/Sessions/${sessionno}" dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call \ --print-reply ${session} org.kde.konsole.Session.sendText string:"$cmd^M" } * Note that you must use the actual control character (0x0d) and not just the string '^M' in your script (i.e. ctrl-v+<enter key> in vim/gvim) Git commit ba204b106577aa0e1c5662272d68b17a9e35cc9b by Jekyll Wu. Committed on 24/03/2012 at 14:30. Pushed by jekyllwu into branch 'master'. Add dbus method runCommand(QString) for running command Although the existing dbus method sendText(QString) can be used to do the same job, it is not very friendly since users have to deal with the problem of how to represent and send the final newline. REVIEW: 104398 FIXED-IN: 4.9.0 M +5 -0 src/Session.cpp M +5 -0 src/Session.h http://commits.kde.org/konsole/ba204b106577aa0e1c5662272d68b17a9e35cc9b |