Sign in Join

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

Mailing lists / lazarus / 2018-04

Terminal Component Available

16 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Anthony Walter

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180410/70ef0438/attachment.html>

Reply by email

Maciej Izak
to Anthony Walter

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 <

Show quoted text 17 lines
: 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180411/142a2fcd/attachment-0001.html>

Reply by email

Michael Van Canneyt
to Maciej Izak
Maciej Izak wrote
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.

Reply by email

Anthony Walter
to Michael Van Canneyt

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180411/aad2a8a4/attachment.html>

Reply by email

Maciej Izak
to Michael Van Canneyt: Huh ? Slight historical misinformation here. Linux editors had this decennia before…

2018-04-11 9:18 GMT+02:00 Michael Van Canneyt via Lazarus <

Show quoted text 7 lines
: 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180411/165d5a07/attachment.html>

Reply by email

Michael Van Canneyt
to Maciej Izak
Maciej Izak wrote 12 lines
2018-04-11 9:18 GMT+02:00 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.

Reply by email

R0b0t1
to Anthony Walter: I'm am starting a new thread because I've completed my task. Here is a terminal component…
Anthony Walter wrote 21 lines
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.

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.

Reply by email

Anthony Walter
to R0b0t1

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. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180412/c40ff49f/attachment.html>

Reply by email

Mark Morgan Lloyd
R0b0t1 wrote
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]

Reply by email

R0b0t1
to Mark Morgan Lloyd

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.

Mark Morgan Lloyd wrote 20 lines
On 12/04/18 05:45, R0b0t1 via Lazarus wrote: > 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

Reply by email

John Landmesser
to Anthony Walter: I'm am starting a new thread because I've completed my task. Here is a terminal component…

for

Lazarus 1.9.0 r57653 FPC 3.0.4 x86_64-linux-gtk2

you need also dynlibs in gtk2term:

uses
   GLib2, Gtk2, dynlibs;
Anthony Walter wrote 23 lines
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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180414/d2a0036e/attachment-0001.html>

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: I cannot speak for others, but I read your statement as stating that the idea of an…
Michael Van Canneyt wrote
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

Reply by email