Okay, so finally I solved this !
Steps :
Open Script Editor app.
Create new Script and paste this code :
on run argv
tell application "Terminal" to activate
tell application "Terminal" to do script "cd ~" in selected tab of the front window
tell application "Terminal" to do script "cd " & item 2 of argv in selected tab of the front window
tell application "Terminal" to do script "clear" in selected tab of the front window
tell application "Terminal" to do script "bash " & item 1 of argv in selected tab of the front window
end run
save this file inside the folder in which you are coding/ or provide path while executing.
This will look like this :
I saved it in /Users/aayush/Downloads folder as automated_run.
This script editor app will save this script as automated_run.scpt.
Now open CodeRunner App.
Select Run Settings...,
Now Copy the command written in Run Command field before the $filename.
[For example, If I am coding in shell scripting then I will copy the bash from the command bash $filename; for python, I will copy python3 from python3 $filename]
Then open the script editor and see the line number 6 and paste your command in place of "bash ". Here I am coding in shell scripting so that as per my requirement, I used 'bash ' here.
Then in CodeRunner, Paste this code in place of run command in Run Setting... :
osascript automated_run.scpt $filename $PWD
It will look like this now :
Now you have two options : you can make this run command as default or you can use this as temporary. That is your choice.
now close this window.
and run any sample program to check this functionality which we just implemented.
Let's run sample program :
I made a sample file named helloaayush.sh and stored that in /Users/aayush/Downloads

Now after pressing the Run button :
A new terminal window will open and your code output will be visible there.

Let me know if something is unclear :)
Answer from Aayush Shah on Stack Overflowmacos - CodeRunner 4.0.3 (Mac software) - how to execute program in Terminal window? - Stack Overflow
What do you think of CodeRunner IDE ?
CodeRunner: Arduino and CodeRunner
What does the extension Code Runner do?
It just runs the code. You still have to install the relevant compiler/interpreter for the language you're trying to run and set it up correctly in your settings.json so Code Runner can use the correct command.
More on reddit.comWhat features does CodeRunner 4 offer?
How secure is CodeRunner 4?
How does CodeRunner 4 software Work?
Videos
Any thought about this IDE ?
Looks really nice, actually using the free 14-days version and thinking about buying a licence... But I'm interested in users' opinions first !
What does the extension Code Runner do?
As I have Python installed on my computer and also installed the Python extension by VSCode, then I had Code Runner uninstalled.
But I can't run Python scripts after that. It says "command 'code-runner.run' not found".
It just runs the code. You still have to install the relevant compiler/interpreter for the language you're trying to run and set it up correctly in your settings.json so Code Runner can use the correct command.
You can still run code from the terminal, if you don't want to have a separate extension