Forum > macOS / Mac OS X

Terminal Doesn't open on MacBook Air M1 2020

(1/2) > >>

cjledbetter:
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:
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:
Alternatively, create a script, eg:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---#!/bin/sh/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:
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:
Open an Applications > Utilities > Terminal, then:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---cd ~/tmp./project1
Or you can run it through the macOS lldb debugger:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---cd ~/tmplldb project1

Navigation

[0] Message Index

[#] Next page

Go to full version