Bug 238032

Summary: RFE : add dbus method readSessionWindow() for geting the visible text in terminal area
Product: [Applications] konsole Reporter: Ram <ramprasad.ap>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: wishlist CC: adaptee, cpigat242
Priority: LO    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ram 2010-05-18 12:34:11 UTC
Version:           kdebase-4.4.2 (using KDE 4.4.2)
OS:                Linux
Installed from:    Fedora RPMs

In kde3 I used to automate mouseclicks & dcop+klipper to screen scrape my konsole output.
Now in kde4 I dont have dcop. How can I automate reading of the konsole content from within my perl script.

  	
I was hoping qdbus can support function like readSessionWindow(); that returns the Visible text on the window
Comment 1 Tom 2011-02-10 02:43:17 UTC
This feature is very much needed!
Comment 2 Frantisek Sindelar 2011-02-10 08:55:20 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Jekyll Wu 2012-04-14 17:46:23 UTC
Well, one obstacle for adding this dbus method is: one session might have multiple independent views, where each view shows different region of the same session output. So to add such a dbus method, it must be per view. But currently konsole creates dbus objects only per window and per session.
Comment 4 Bug Janitor Service 2023-12-29 04:15:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/941
Comment 5 Kurt Hindenburg 2024-01-13 17:34:21 UTC
Git commit b27e80f2b51214596b1d5bdbd52a91bfa2450b82 by Kurt Hindenburg, on behalf of Theodore Wang.
Committed on 13/01/2024 at 18:34.
Pushed by hindenburg into branch 'master'.

Implemented DBus methods for reading displayed text

The four methods allow users to retrieve the text displayed on a
view.

1. Session::getAllDisplayedText
2. Session::getAllDisplayedTextList
3. Session::getDisplayedText
4. Session::getDisplayedTextList

They can choose the return value to be a single string. Or call
the "...List" methods to get a list where every list element is
the text on a single line.

For methods "getAllDisplayedText" and "getAllDisplayedTextList",
the user can specify if trailing empty lines should be removed.

For the other two methods, the user can specify the range of
lines to be retrieved.

M  +63   -0    src/session/Session.cpp
M  +29   -0    src/session/Session.h

https://invent.kde.org/utilities/konsole/-/commit/b27e80f2b51214596b1d5bdbd52a91bfa2450b82