Recent

Author Topic: How to RUN Console programs from Lazarus ?  (Read 571 times)

demosthenesk

  • Newbie
  • Posts: 2
How to RUN Console programs from Lazarus ?
« on: September 29, 2022, 11:09:54 am »
Hello,
i am learning Free Vision and i write console apps.

When i press RUN from lazarus ide the program starts but it does not show up in terminal.
I use Ubuntu Linux and i ask help to show up the running app in a terminal console.

I can pause and stop program but not show the console.
How can i RUN console programs from Lazarus ?

demosthenesk

  • Newbie
  • Posts: 2
Re: How to RUN Console programs from Lazarus ?
« Reply #1 on: September 29, 2022, 11:20:30 am »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: How to RUN Console programs from Lazarus ?
« Reply #2 on: September 29, 2022, 11:33:54 am »
OK, I see you've found the solution but a few extra points.

First, when asking about something please put the version numbers of the tools you're using (i.e. Lazarus, FPC) in the body of your message. Also pertinent info about your OS.

Second, you've probably seen from that wiki page that there's a console output window which you can use while debugging. However it really is very basic with no support for cursor-positioning escape sequences and so on.

An alternative way is to start the program from a shell session, then to use the IDE's Run -> Attach to program... to connect the debugger to the program. That gives you the best of both worlds, since you'll have properly-formatted output but also breakpoints etc.

MarkMLl

p.s. RUN isn't an acronym, you don't have to capitalise it :-)
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: How to RUN Console programs from Lazarus ?
« Reply #3 on: September 29, 2022, 11:39:25 am »
(Maybe lazarus also have options to execute using another terminal program ? If so, try to run it with xterm, it generally was the most compatible terminal emualtor)

 

TinyPortal © 2005-2018