Sign in Join

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

Mailing lists / lazarus / 2011-04

Terminal in Lazarus

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys
to Geoffray Levasseur: I'm trying to create a build manager for own compiled package. The project is in a good…

2011/4/16 Geoffray Levasseur :

In fact the best will be something like an xterm clone but in pascal...

Take a look at the DoubleCommander project on SourceForge. They have already implement just that in their twin-view file manager.

http://doublecmd.sourceforge.net

I believe that project is GPL based, so not sure if you can use that terminal component in your applications though.

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

Reply by email

Geoffray Levasseur

Hi,

I'm trying to create a build manager for own compiled package. The project is in a good way but the next step is a bit hard for me. To complete the software, I need to have an integrated terminal. Here are the constraint: 1 - I need to be able to use environment variable, so once the terminal is open it will use the same shell until the job is complete. 2 - Each command (sometimes complex ones, e.g. "for" and "if" statement) will be added line by line (from a TString) at runtime and each time a command is complete I need to now its exit code.
3 - As this will be most of the time bash (or zsh if the user chose this), the shell can change at runtime with perl or python. I still must be able to interact with those shell.
4 - The terminal will be embedded in a Lazarus form (do not matter if it's created at runtime).
5 - Ideally all the output can be logged in a text file.

In fact the best will be something like an xterm clone but in pascal...

Any ideas on how to do this?
Thanks

Geoffray ? fatalerrors ? Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Sic luceat lux et pax. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110416/e69091c9/attachment.bin>

Reply by email

Geoffray Levasseur
to Graeme Geldenhuys: 2011/4/16 Geoffray Levasseur : Take a look at the DoubleCommander project on SourceForge.…

Le samedi 16 avril 2011 12:37:23, Graeme Geldenhuys a ?crit :

Show quoted text 8 lines
Take a look at the DoubleCommander project on SourceForge. They have already implement just that in their twin-view file manager. http://doublecmd.sourceforge.net I believe that project is GPL based, so not sure if you can use that terminal component in your applications though.

It seems to use a component called TCmdBox. It's LGPL and DoubleCommander overload this component to allow the execution of Bash. It's GPL just as my software so no problem with licenses.

I just have to study this to integrate it correctly in my app.

Thanks.

Geoffray ? fatalerrors ? Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Sic luceat lux et pax. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110416/c21b6c8f/attachment.bin>

Reply by email

Geoffray Levasseur
to Geoffray Levasseur

Le samedi 16 avril 2011 21:59:36, Geoffray Levasseur a ?crit :

It seems to use a component called TCmdBox. [...]

This is finally not really appropriate in my case as it can't handle many console apps (like mc or ccmake and the last is very important for me).

I just have to study this to integrate it correctly in my app.

I've studied and thinking about using VTE library as it seems easy to use (I've made the biggest with h2pas). The bad point is that VTE depends on GTK2 and GLib. Ideally I would like a widget independent library... If someone know any other I'll take it or even no library at all (the less I have dependencies, the more I'll be happy).

The other option would be having VTE for GTK and a Qt equivalent for Qt. This is important in my case to have both Qt and GTK ready apps. This could be complicated and not very efficient so i'm not sure of that.

My last idea, but this may be a big work is to rewrite something existing in Pascal (e.g. xterm, urwt, vte...). What do you think of the feasibility of this?

Geoffray ? fatalerrors ? Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Sic luceat lux et pax. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110417/2a65029b/attachment.bin>

Reply by email

Malcolm Poole
to Geoffray Levasseur: I'm trying to create a build manager for own compiled package. The project is in a good…
Geoffray Levasseur wrote 20 lines
Hi, I'm trying to create a build manager for own compiled package. The project is in a good way but the next step is a bit hard for me. To complete the software, I need to have an integrated terminal. Here are the constraint: 1 - I need to be able to use environment variable, so once the terminal is open it will use the same shell until the job is complete. 2 - Each command (sometimes complex ones, e.g. "for" and "if" statement) will be added line by line (from a TString) at runtime and each time a command is complete I need to now its exit code. 3 - As this will be most of the time bash (or zsh if the user chose this), the shell can change at runtime with perl or python. I still must be able to interact with those shell. 4 - The terminal will be embedded in a Lazarus form (do not matter if it's created at runtime). 5 - Ideally all the output can be logged in a text file. In fact the best will be something like an xterm clone but in pascal... Any ideas on how to do this?

It is possible to embed a libvte terminal in a lazarus form when using GTK and control it from the application, although I'm not sure if it's possible to do everything that you want.

Pascal bindings for libvte and a test application can be found at http://dargui.svn.sourceforge.net/viewvc/dargui/testvte/

Malcolm

Reply by email

Geoffray Levasseur
to Malcolm Poole

Le dimanche 17 avril 2011 23:43:01, Malcolm Poole a ?crit :

Show quoted text 9 lines
It is possible to embed a libvte terminal in a lazarus form when using GTK and control it from the application, although I'm not sure if it's possible to do everything that you want. Pascal bindings for libvte and a test application can be found at http://dargui.svn.sourceforge.net/viewvc/dargui/testvte/ Malcolm

I'm trying to use your VTE implementation (with the help of the demo app) and I'm facing a problem that I can't understand: impossible to get the shell working even if the VTE widget is appearing correctly and no errors happens according to my log file.

Here is the source code for the application I'm trying to create (with svn): svn://svn.tuxfamily.org/svnroot/geofperspage/gppsvn/trunk/lfs-manager

Can someone take a look and tell me what can be wrong (I've checked everything without success).

Thanks

Geoffray ? fatalerrors ? Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Errare humanum est, sed perseverare diabolicum et cretinum. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110430/8a933edd/attachment.bin>

Reply by email

Malcolm Poole
to Geoffray Levasseur
Geoffray Levasseur wrote 18 lines
Le dimanche 17 avril 2011 23:43:01, Malcolm Poole a ?crit : > It is possible to embed a libvte terminal in a lazarus form when using > GTK and control it from the application, although I'm not sure if it's > possible to do everything that you want. > > Pascal bindings for libvte and a test application can be found at > http://dargui.svn.sourceforge.net/viewvc/dargui/testvte/ I'm trying to use your VTE implementation (with the help of the demo app) and I'm facing a problem that I can't understand: impossible to get the shell working even if the VTE widget is appearing correctly and no errors happens according to my log file. Here is the source code for the application I'm trying to create (with svn): svn://svn.tuxfamily.org/svnroot/geofperspage/gppsvn/trunk/lfs-manager Can someone take a look and tell me what can be wrong (I've checked everything without success).

I'm not clear what you're trying to do, as I cannot load your project fully or compile it due to the absence of cmdbox, LCLBase and FCL packages on my system, but you need to remove line 206 " Terminal.Execute; " from fMain. Your GTKTerm should then work as a normal embedded shell.

The command 'Execute' is used when the terminal has been created with a command as parameter - see explanatory notes at line 41 of VTETerminal.pas

I'm not sure if it is possible to execute more than one command remotely on the same terminal - closer examination of the GTK VTETerminal documentation would probably provide this information.

Reply by email