Recent

Author Topic: Terminal Doesn't open on MacBook Air M1 2020  (Read 2443 times)

cjledbetter

  • Newbie
  • Posts: 3
Terminal Doesn't open on MacBook Air M1 2020
« on: February 06, 2022, 10:54:14 pm »
Hi,
I try to run a simple hello world command line program and the terminal doesn't open.  The executable file is created when I save and works.  I've used windows 10 and it works no problem.  I would rather use Mac.  Any help will be greatly appreciated.
Running Monterey 12.2
Lazarus IDE 2.2.0

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Terminal Doesn't open on MacBook Air M1 2020
« Reply #1 on: February 07, 2022, 12:44:40 am »
You can either open a terminal yourself and run the console application from there or add an execute after command and have the output show up in the Messages window.

See attached pics for how to do the latter.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Terminal Doesn't open on MacBook Air M1 2020
« Reply #2 on: February 07, 2022, 01:57:44 am »
Alternatively, create a script, eg:

Code: Text  [Select][+][-]
  1. #!/bin/sh
  2. /System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal ~/tmp/project1

and add it to the Lazarus > Run > Run parameters > Host application field.

This pops up a Terminal with which you can interact with your console application.

Note: Does not work with debugging, only run w/o debugging.

cjledbetter

  • Newbie
  • Posts: 3
Re: Terminal Doesn't open on MacBook Air M1 2020
« Reply #3 on: February 07, 2022, 02:34:12 am »
Thank you @trev, I got the script to work (without debugging not ideal though).  How do I run the console application in the terminal?

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Terminal Doesn't open on MacBook Air M1 2020
« Reply #4 on: February 07, 2022, 04:15:58 am »
Open an Applications > Utilities > Terminal, then:

Code: Text  [Select][+][-]
  1. cd ~/tmp
  2. ./project1

Or you can run it through the macOS lldb debugger:

Code: Text  [Select][+][-]
  1. cd ~/tmp
  2. lldb project1

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9908
  • Debugger - SynEdit - and more
    • wiki
Re: Terminal Doesn't open on MacBook Air M1 2020
« Reply #5 on: February 07, 2022, 12:44:54 pm »
If debugging, you can not specify a terminal in "Run Params"

But IIRC under Tools>OPtions>Debugger>Backend  is an option (checkbox in property grid) to open a terminal / you can't specify any params...).
If that is on, and does not work, please send a log:
https://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

cjledbetter

  • Newbie
  • Posts: 3
Re: Terminal Doesn't open on MacBook Air M1 2020
« Reply #6 on: February 10, 2022, 02:30:33 am »
Thanks, using the terminal works.  This is solved for me.

Spira

  • Newbie
  • Posts: 1
Re: Terminal Doesn't open on MacBook Air M1 2020
« Reply #7 on: March 17, 2022, 01:34:26 pm »
Hi,

under Mac OS X in Preferences->Debugger->Debugger backend and set the option LaunchNewTerminal, I am using lldb debugger. It does function for me and the debugging of command line programms.

Regards

Spira

 

TinyPortal © 2005-2018