Discussion:
[Lazarus] Terminal Component Available
Anthony Walter via Lazarus
2018-04-11 03:12:52 UTC
Permalink
I'm am starting a new thread because I've completed my task.

Here is a terminal component for Lazarus that is easy to reuse.

https://cache.getlazarus.org/archives/terminal.7z

To install, make sure you're on Linux with a Gtk2 copy of Lazarus. Open
package terminaldsgn.lpk, install, and rebuild the IDE. You'll have a
TTerminal component on your pallet. Drop it on a form, press run, and you
have your own terminal program.

Here is a longish video walk through of how it works:

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

The source code is completely free, copy left, if anyone wants to reuse it.

Notes, you need to be using Linux and have libvte for gtk2 installed to use
the component. You can be running other platforms, but you'll just see the
design time surface it you're not on Linux.
Anthony Walter via Lazarus
2018-04-11 06:43:22 UTC
Permalink
I updated my archive to include support for a dockable window inside the
Lazarus IDE.

https://cache.getlazarus.org/videos/vte-embedded.mp4
Maciej Izak via Lazarus
2018-04-11 07:15:39 UTC
Permalink
Very good initiative (Visual Studio Code inspired) . I wish to had this for
Windows too :)

2018-04-11 8:43 GMT+02:00 Anthony Walter via Lazarus <
Post by Anthony Walter via Lazarus
I updated my archive to include support for a dockable window inside the
Lazarus IDE.
https://cache.getlazarus.org/videos/vte-embedded.mp4
--
_______________________________________________
Lazarus mailing list
https://lists.lazarus-ide.org/listinfo/lazarus
--
Best regards,
Maciej Izak
Michael Van Canneyt via Lazarus
2018-04-11 07:18:34 UTC
Permalink
Post by Maciej Izak via Lazarus
Very good initiative (Visual Studio Code inspired) . I wish to had this for
Windows too :)
Huh ? Slight historical misinformation here.

Linux editors had this decennia before Visual Studio came up with it.

Michael.
--
Anthony Walter via Lazarus
2018-04-11 07:37:40 UTC
Permalink
By the way, there is a small bug with the IDE I discovered while making
this. If you dock a window, then right click and close it, or undock it,
window cannot be docked again. You have to restart the IDE to be able to
dock that window type. Here is a screen capture of the issue:

https://cache.getlazarus.org/videos/dock-bug.mp4
Maciej Izak via Lazarus
2018-04-11 08:29:29 UTC
Permalink
2018-04-11 9:18 GMT+02:00 Michael Van Canneyt via Lazarus <
Post by Michael Van Canneyt via Lazarus
Huh ? Slight historical misinformation here.
Linux editors had this decennia before Visual Studio came up with it.
Huh? What is wrong with you? Where you have historical misinformation? It
is personal view. It looks similar like in VSC and probably like in many
other editors in positive meaning.

Feel free to provide full historical context. Insane.
--
Best regards,
Maciej Izak
Michael Van Canneyt via Lazarus
2018-04-11 08:40:30 UTC
Permalink
Post by Maciej Izak via Lazarus
2018-04-11 9:18 GMT+02:00 Michael Van Canneyt via Lazarus <
Post by Michael Van Canneyt via Lazarus
Huh ? Slight historical misinformation here.
Linux editors had this decennia before Visual Studio came up with it.
Huh? What is wrong with you? Where you have historical misinformation? It
is personal view. It looks similar like in VSC and probably like in many
other editors in positive meaning.
I cannot speak for others, but I read your statement as stating that the idea
of an embedded terminal comes from VSC.
If this is not what you meant, I apologize for my reaction.

Michael.
--
Graeme Geldenhuys via Lazarus
2018-04-14 15:39:34 UTC
Permalink
Post by Michael Van Canneyt via Lazarus
I cannot speak for others, but I read your statement as stating that the idea
of an embedded terminal comes from VSC.
That is how I read his message as well. And I fully agree Michael - I
think Linux editors beat Visual Studio on that one by quite a few years. :-)

Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key: http://tinyurl.com/graeme-pgp
--
R0b0t1 via Lazarus
2018-04-12 05:33:44 UTC
Permalink
On Tue, Apr 10, 2018 at 10:12 PM, Anthony Walter via Lazarus
Post by Anthony Walter via Lazarus
I'm am starting a new thread because I've completed my task.
Here is a terminal component for Lazarus that is easy to reuse.
https://cache.getlazarus.org/archives/terminal.7z
To install, make sure you're on Linux with a Gtk2 copy of Lazarus. Open
package terminaldsgn.lpk, install, and rebuild the IDE. You'll have a
TTerminal component on your pallet. Drop it on a form, press run, and you
have your own terminal program.
https://cache.getlazarus.org/videos/vte-finished.mp4
The source code is completely free, copy left, if anyone wants to reuse it.
Notes, you need to be using Linux and have libvte for gtk2 installed to use
the component. You can be running other platforms, but you'll just see the
design time surface it you're not on Linux.
I appreciate your work.

Did you ever try to make it cross platform? I only ask as I have not
found a good way to embed either PowerShell or cmd.exe.
--
Anthony Walter via Lazarus
2018-04-12 07:20:32 UTC
Permalink
R0b0t1,

If you look at the sources you'll see I simply wrapped some of the
functionality of gnome's terminal component inside a LCL TCustomControl
class. Two function calls actually, vte_terminal_new
and vte_terminal_fork_command_full. The gnome tool kit, or gtk for short,
takes care of the rest. Its functionality includes text styles (bold,
underline), colors, keyboard accelerators, hyperlinks, command history,
variable expansion, among other things. But as this is implemented by the
gnome tool kit for Linux, sorry it's not portable.

However, if you just want to embed a text terminal with no features other
than typing text and executing command, and have those results shown in the
same window, it can be easily done on any platform with a TMemo control and
TProcess class using pipes to redirect stdin, stdout, and stderr.
Mark Morgan Lloyd via Lazarus
2018-04-12 18:50:53 UTC
Permalink
Did you ever try to make it cross platform? I only ask as I have notfound a good way to embed either PowerShell or cmd.exe.
I did it years ago for cmd.exe on Delphi, I think it used pipes in some
form.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
--
R0b0t1 via Lazarus
2018-04-12 19:22:52 UTC
Permalink
There is a bit more to adapt all features of cmd.exe, especially
colors. The interface is handled by a windows DLL and kind of clunky,
so you need to hook functions. That is why I was wondering if it had
already been done.

On Thu, Apr 12, 2018 at 1:50 PM, Mark Morgan Lloyd via Lazarus
Post by Mark Morgan Lloyd via Lazarus
Did you ever try to make it cross platform? I only ask as I have notfound
a good way to embed either PowerShell or cmd.exe.
I did it years ago for cmd.exe on Delphi, I think it used pipes in some
form.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
--
_______________________________________________
Lazarus mailing list
https://lists.lazarus-ide.org/listinfo/lazarus
--
Anthony Walter via Lazarus
2018-04-13 13:30:48 UTC
Permalink
I've posted this project to github:

https://github.com/sysrpl/Lazarus.Terminal

Enhancements now include custom colors and fonts.
Anthony Walter via Lazarus
2018-04-13 23:48:16 UTC
Permalink
This was just posted on reddit:

https://www.reddit.com/r/linux/comments/8bz9p4/a_look_at_terminal_emulators_part_1/

https://anarc.at/blog/2018-04-12-terminal-emulators-1/

A comparison of terminal emulators. Most are using VTE.
John Landmesser via Lazarus
2018-04-14 09:08:14 UTC
Permalink
for

Lazarus 1.9.0 r57653 FPC 3.0.4 x86_64-linux-gtk2

you need also dynlibs in gtk2term:

uses
  GLib2, Gtk2, dynlibs;
Post by Anthony Walter via Lazarus
I'm am starting a new thread because I've completed my task.
Here is a terminal component for Lazarus that is easy to reuse.
https://cache.getlazarus.org/archives/terminal.7z
To install, make sure you're on Linux with a Gtk2 copy of Lazarus.
Open package terminaldsgn.lpk, install, and rebuild the IDE. You'll
have a TTerminal component on your pallet. Drop it on a form, press
run, and you have your own terminal program.
https://cache.getlazarus.org/videos/vte-finished.mp4
The source code is completely free, copy left, if anyone wants to reuse it.
Notes, you need to be using Linux and have libvte for gtk2 installed
to use the component. You can be running other platforms, but you'll
just see the design time surface it you're not on Linux.
Anthony Walter via Lazarus
2018-04-14 20:04:34 UTC
Permalink
Maybe someone can clarify the Dynlibs unit issue, because I'm on the same
toolkit, platform, and compiler, yet there is no need to include Dynlibs.
Loading...