Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-04

E,bedding a terminal window in Lazarus

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

It looks like adding a terminal window to any Gtk 2/3 application isn't that difficult if you use a library called libvte.

I am considering writing an IDE package to do this, but wanted to know if anyone knows if this has been done before, and if the libvte functions already have a pascal declaration, or maybe an LCL compatible exampl somewhere.

Here is a brief overview:

https://cache.getlazarus.org/videos/libvte-question.mp4 -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180409/342e6d73/attachment.html>

Reply by email

Mark Morgan Lloyd
to leledumbo
leledumbo wrote
> I am considering writing an IDE package to do this, but wanted to know ifanyone knows if this has been done before AFAIK, no. Previous attempts don't embed actual terminal, but use aterminal like component with application controlled command to execute.

Could I throw one thing in here which probably isn't immediately helpful.

A couple of months ago, working on Linux, I experimented with embedding Xnest/Xephyr sessions in LCL (GTK2?) panels, with the object being to present multiple copies of a program that refused to run more than one instance per X server on the same screen.

It didn't work directly, but I was /was/ in the end able to embed an xterm in an LCL panel, then embed Xnest/Xephyr in the xterm... it was crude since I'd put minimal effort into sizing etc. the panels, but it worked as a POC.

So I suspect that there's something- possibly a Window Manager hint- that's being unnecessarily propagated into panels that possibly needn't be, and that is likely to cause problems embedding at least some standalone programs (as distinct from specially-written components).

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Anthony Walter
to Mark Morgan Lloyd

Okay, well I got some stuff done. I'm able to create a fully working terminal application using fpc, but when I try to incorporate it into a TWinControl there are some problems:

https://cache.getlazarus.org/videos/vte-control.mp4

Notably, I believe the LCL gtk2 widgetset makes some core assumptions about the internal memory layout of any PGtkWidget that do not apply to a PVteTerminal. This is causing access violations when it interacts with the LCL as the LCL tries to access structures and that do not exists.

Here is the code for the TTerminal control (designed to work only on gtk2). Maybe someone could recommend a fix?

https://pastebin.com/y8wFvKsg

A code archive for both projects here:

http://cache.getlazarus.org/archives/simterm.7z
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180410/c9d5d15a/attachment.html>

Reply by email