https://bugs.kde.org/show_bug.cgi?id=442740

Lach Sławomir <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Product|frameworks-kio              |frameworks-kded
         Resolution|---                         |WAITINGFORINFO
          Component|general                     |general
            Version|5.86.0                      |unspecified
             Status|CONFIRMED                   |NEEDSINFO

--- Comment #9 from Lach Sławomir <[email protected]> ---
Idea 3)
But what about binary files? My solution work with binary files too.

And there no analyze of content of file. There is only analyze of program
behavior. We create pty (pseudoterminal), but do not spawn terminal window. In
next step, we start the program. We now listen for request to read data from
stdin. If program does, we assume it is console program. If it does, we spawn a
terminal with server program attached. This server is some kind of proxy, which
would redirect all signals from real terminal window to pty created in first
step, show output of program, send input from real terminal to input of created
pty, etc. As I said in forum post, the server is currently very simple and
there is a lot of think to made better (for example reporting terminal size,
etc.). It all is designed to work with program, which are not created to work
with this tool.

Of course, there is many problems currently:
1) Server program is very simple
2) It do not always detects program type correctly
a) As I said, we assume program can write to console if it is graphical (I
describe current solution further)
b) There could exist bash script, which use zenity/kdialog (it is graphical,
but  zenity/kdialog is running in separate processes, so we do not detect this;
maybe use cgroups?)
c) Program could end very fast - before we properly detect it's type (as I
said, we read info about loaded libraries and opened files)

About a and c - if program end working and we do not recognize it as gui, we
could show message telling user that program exits and user should click on
show console button.
About b - maybe cgroups allows us to detect if program run another process and
introspect new child, so we detect it loads Xlib/Xcb or connect to wayland
server? But.. this brings new problems, probably.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to