Recent

Author Topic: Your Terminal type is unknown!  (Read 849 times)

hakelm

  • Full Member
  • ***
  • Posts: 112
Your Terminal type is unknown!
« 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

Thaddy

  • Hero Member
  • *****
  • Posts: 9183
Re: Your Terminal type is unknown!
« Reply #1 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>
« Last Edit: June 26, 2019, 11:32:25 pm by Thaddy »
also related to equus asinus.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5699
    • wiki
Re: Your Terminal type is unknown!
« Reply #2 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...

Thaddy

  • Hero Member
  • *****
  • Posts: 9183
Re: Your Terminal type is unknown!
« Reply #3 on: June 26, 2019, 11:46:15 pm »
This message is also not in Lazarus as far as grep is concerned...
also related to equus asinus.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5699
    • wiki
Re: Your Terminal type is unknown!
« Reply #4 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)

lucamar

  • Hero Member
  • *****
  • Posts: 2080
Re: Your Terminal type is unknown!
« Reply #5 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? :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

hakelm

  • Full Member
  • ***
  • Posts: 112
Re: Your Terminal type is unknown!
« Reply #6 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