Easy way to embed a shell in UI?

Is there an easy way to embed a shell into my application UI using GTK?
Alternatively, is there an easy enough way to run a program and send its stdout to a widget in a suitable way?

If there are no easy built-in way, what is the go-to way for showing stdout on the UI?

That would be libVTE

You probably could use GSubprocess and manual read (beware of deadlocks with subprocesses!) or e.g. GOutputStream.splice() into a memory stream to achieve something reasonable.
But if a full terminal emulation is what you need, libVTE is the way to go.

I see, so I either need a dedicated library for terminal or make my own implementation. What I need is a far less than full interactive terminal, so I guess it is fairly doable by myself. Thank you!

Do you really need to avoid using libVTE? unless you’ve got a reason not to, it’s most likely the easiest and most robust way to go, and libVTE is a widely used library so it’s likely to be available in your target environment (yet I don’t know your specific case, of course).

Yes, to use libVTE in my environment I have to write FFI for it manually. I want to avoid that. Especially since I do not require the full interactive shell.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.