Lazarus

Using the Lazarus IDE => Debugger => Topic started by: hakelm on June 26, 2019, 10:45:29 pm

Title: Your Terminal type is unknown!
Post by: hakelm on June 26, 2019, 10:45:29 pm
When debugging a console application using Lynx (which I believe in turn relies on ncurses) in Lazarus IDE I get

  Your Terminal type is unknown!
  Enter a terminal type: [vt100]

and the program halts.
What can I do?
My system is Ubuntu 16.04.
H
Title: Re: Your Terminal type is unknown!
Post by: Thaddy on June 26, 2019, 11:16:03 pm
If you grep the fpc sources you could have known this is not in FreePascal at all.
Look elsewhere....
I did:
Code: Bash  [Select][+][-]
  1. grep -nHIirF --  Your Terminal type is unknown
  2. No matches found.
On my fpc base directory
Noone result...Nothing whatsoever...

I'd recommend everyone to have at least a grasp of Grep. or similar tools.....Saves a lot of answering the obvious.
When asked a question, I expect you do some effort before I can seriously and quickly answer it.
This is a known bug in most of the forum members, though, just do not try this too often without putting in some research yourself.... :'( :-X ;D ;D ;D

Try: "Google, can you look up this text in the freepascal manuals: Your terminal type is not supported.'
Or the same with Alexa .... :o :D :D

90% or more do not even read the excellent manuals....<grumpy  >:D, a little>
Title: Re: Your Terminal type is unknown!
Post by: Martin_fr on June 26, 2019, 11:43:14 pm
The debugger in the IDE does not supply a full terminal.

You can start your app outside the IDE, and use the "attach" feature to debug it. (if you can attach, before you reach the code you want to debug).


There also is a setting (somewhere Tools > OPtions > Debugger), not sure of the setting name (something with tty or pty).
It allows you to tell gdb to attach you apps stdin/out to the pty you specify. You need to open the pty before (eg by running a terminal)
https://wiki.lazarus.freepascal.org/Debugger_Console_App#Lazarus_0.9.31

You may also be able to get it done by using gdbserver. Never tried that...
Title: Re: Your Terminal type is unknown!
Post by: Thaddy on June 26, 2019, 11:46:15 pm
This message is also not in Lazarus as far as grep is concerned...
Title: Re: Your Terminal type is unknown!
Post by: Martin_fr on June 27, 2019, 12:12:50 am
This message is also not in Lazarus as far as grep is concerned...
He tries to debug something that requires a proper terminal. (Rather than just plain stdin/out).
So the app he uses will refuse to run, if started in the lazarus default debugger.

There may be other limits. Since it appears he uses a "launching app", the debugger needs to find his code, inside the launching app process. That should work for libraries (dll/so).
But it usually only works, if the launching app does not fork child processes (to be exact, his code must be in the main/initial process)
Title: Re: Your Terminal type is unknown!
Post by: lucamar on June 27, 2019, 12:32:29 am
Isn't Lynx a text-mode web browser? If so, yes, it uses ncurses.

And what do you mean by "[...] debugging a console application using Lynx [...]"? Is your application calling Lynx or viceversa? Because that message may be coming from Lynx--it can be quite temperamental sometimes.

Or neither and I'm barking up the wrong tree? :)
Title: Re: Your Terminal type is unknown!
Post by: hakelm on June 27, 2019, 10:28:02 am
Thanks a lot,
'attach to program' did the trick. Putting a readln; at the beginning of the program allows me to attach and it works like a breeze.
'Your Terminal type is unknown' is part of ncurses which is used by Lynx which my program launches to automatically keep me updated on changes in certain web-servers.
H
TinyPortal © 2005-2018