User forums > Using Code::Blocks
[MacOSX 10.15][svn-r12240]zsh: no such file or directory
Suryavarman:
I have see the same problem on other thread and other web site .
When i launch terminal application from CB i have this message:
[…] zsh: no such file or directory […]
--- Code: ---➜ ~ zsh --version
zsh 5.8 (x86_64-apple-darwin19.6.0)
--- End code ---
I have try this solutions:
https://sourabhbajaj.com/mac-setup/iTerm/zsh.html
or
https://technobyte.org/install-code-blocks-on-mac-os-gcc-compiler/ (watch the comments)
```
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
chsh -s /bin/zsh
source ~/.zhrc
```
Here the other topics:
http://forums.codeblocks.org/index.php/topic,23357.msg159018.html#msg159018
http://forums.codeblocks.org/index.php/topic,18907.msg129527.html#msg129527
I continue my investigation. :p
Suryavarman:
With Codelite with a simple «Hello World» project work.
Here the terminal how is calling:
--- Code: ---/Applications/codelite.app/Contents/MacOS/osx-terminal.sh "cd /Users/toto/folder/Test_CL_Mac/Debug && ./Test_Terminal\ "
--- End code ---
The code of osx-terminal.sh file is:
--- Code: ---#!/bin/sh
echo '
on run argv
if length of argv is equal to 0
set command to ""
else
set command to item 1 of argv
end if
if length of argv is greater than 1
set profile to item 2 of argv
runWithProfile(command, profile)
else
runSimple(command)
end if
end run
on runSimple(command)
tell application "Terminal"
activate
set newTab to do script(command)
end tell
return newTab
end runSimple
on runWithProfile(command, profile)
set newTab to runSimple(command)
tell application "Terminal" to set current settings of newTab to (first settings set whose name is profile)
end runWithProfile
' | osascript - "$@" > /dev/null
--- End code ---
The command to call a terminal application with CB is here:
--- Code: ---osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script quoted form of "$SCRIPT"' -e 'end tell'
--- End code ---
Example:
--- Code: ---osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script quoted form of "/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=:. /.../Test_App/bin/Debug/Test_App "' -e 'end tell' (in /.../Test_App/.)
--- End code ---
On CB Linux the command with xterm is :
--- Code: ---xterm -T $TITLE -e
--- End code ---
Example:
--- Code: ---Checking for existence: /directory/APP/bin/Debug/APP
Set variable: LD_LIBRARY_PATH=.:/some/paths
Executing: xterm -T APP -e /path/CodeBlocks/bin/cb_console_runner LD_LIBRARY_PATH=:.:/some/paths /directory/APP/bin/Debug/APP -e "some arguments" (in /directory/APP/.)
--- End code ---
Suryavarman:
Like that C::B launch the application (doesn't work very well in debug : I use /usr/local/Cellar/gdb/10.1/bin/gdb).
--- Code: ---/Applications/codelite.app/Contents/MacOS/osx-terminal.sh "$SCRIPT"'
--- End code ---
solution:
create osx-terminal.sh file where you want (YOUR_DIRECTORY).
put this code inside:
(The code come from https://codelite.org/)
--- Code: ---#!/bin/sh
echo '
on run argv
if length of argv is equal to 0
set command to ""
else
set command to item 1 of argv
end if
if length of argv is greater than 1
set profile to item 2 of argv
runWithProfile(command, profile)
else
runSimple(command)
end if
end run
on runSimple(command)
tell application "Terminal"
activate
set newTab to do script(command)
end tell
return newTab
end runSimple
on runWithProfile(command, profile)
set newTab to runSimple(command)
tell application "Terminal" to set current settings of newTab to (first settings set whose name is profile)
end runWithProfile
' | osascript - "$@" > /dev/null
--- End code ---
Save it.
Got to Codeblocks > Settings > Environment… > rescale the window on the bottom to see the field: Terminal to launch programs:
Replace the text by:
/YOUR_DIRECTORY/osx-terminal.sh "$SCRIPT"'
omlk:
You have set up an environment in MacOS? And I no use MacOS - maybe need restart OS after set environment PATH where you install zsh. Replase in_this_folder_instaled_zsh into path to zsh
--- Code: ---# Add commonly used folders to $PATH export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:in_this_folder_instaled_zsh"
--- End code ---
oBFusCATed:
@omlk: You have no idea what you're talking about...
@Suryavarman:
I've tried it and it kind of works, but not good enough.
Problems:
1. The terminal doesn't close itself automatically after the executable ends.
2. I couldn't make the gdb to run. Some code signing issues. Are you able to debug using this wrapper script?
Navigation
[0] Message Index
[#] Next page
Go to full version