Lazarus

Announcements => Third party => Topic started by: Edson on October 11, 2018, 04:33:05 am

Title: Linux Terminal Emulator in Free Pascal
Post by: Edson on October 11, 2018, 04:33:05 am
Some time ago I developed a simple Terminal Emulator in Free Pascal: https://github.com/t-edson/Titty

I share it for someone who has problem to read the output of a rebel process in Linux, that only works well in a terminal.
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Thaddy on October 11, 2018, 06:54:34 am
I see the code has a getmem call, but no freemem? on exit?
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: af0815 on October 11, 2018, 08:21:37 am
Is there theinformation in english too ? At github and inthe blog there is no english info.
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Thaddy on October 11, 2018, 08:41:27 am
google translate did a good job...
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Edson on October 11, 2018, 04:38:52 pm
I see the code has a getmem call, but no freemem? on exit?

Good observation. Not so critical considering execvp() will never finish  >:D I'm sure there is some better way to implement this.

And there is not validation for the value returned in fpfork().

This is a very basic example, used to show how create terminals.
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Edson on October 11, 2018, 04:41:22 pm
Is there theinformation in english too ? At github and inthe blog there is no english info.

Sorry. I public a lot of information in my native language.

This code is based on http://rachid.koucha.free.fr/tech_corner/pty_pdip.html. There you can find more information in english but using C.
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Thaddy on October 11, 2018, 05:12:30 pm
Edson, according to a compile with -glh the memory is not a leak...  Nice code except from the 5 (I got around that by giving the executable some more rights)
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Edson on October 11, 2018, 06:35:46 pm
Nice code except from the 5

What is 5?  Post #5?

I got around that by giving the executable some more rights
Do you refer I must use another license for the code?
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: af0815 on October 11, 2018, 08:33:04 pm
There you can find more information in english but using C.
Thank you, now it is clear for me. The google translation was not good enough for me to understand.
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Thaddy on October 12, 2018, 07:51:42 am
Do you refer I must use another license for the code?
No: runtime error 5.
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Edson on October 12, 2018, 06:10:41 pm
No: runtime error 5.

http://forum.lazarus.freepascal.org/index.php?topic=4936.0
Title: Re: Linux Terminal Emulator in Free Pascal
Post by: Thaddy on October 12, 2018, 06:51:08 pm
No: runtime error 5.

http://forum.lazarus.freepascal.org/index.php?topic=4936.0
Yes. I know.... :) but Bart's solution is not complete: simply adapt rights.
But you should fix your code accordingly.
TinyPortal © 2005-2018