Significance of "Execute in terminal" option in IntelliJ IDEA - bash

I am trying to create a shell script run configuration with existing system utilities. Here's a test Run Configuration for printing the present working directory.
Output for this Run Configuration :
When I uncheck the Execute in terminal option in the Run Configuration, I get this output :
What is the significance of this option and is it possible to make it work with the Execute in terminal option unchecked?
IDE version : IntelliJ IDEA 2020.3 (Community Edition), Build #IC 203.5981.155
OS : Ubuntu 20.04.1 LTS

IntelliJ comes bundled with a terminal plugin simply called "Terminal".
When you have the plugin enabled, and the checkbox "Execute in the terminal" checked, the run config will be run inside the "Terminal" window, within your usual interactive shell.
With the checkbox unchecked, it runs in the "Run" window instead.
When you have the plugin disabled, the checkbox makes no difference.
Also note that in newer versions of IntelliJ (I'm on 2022.2.3 currently), there is a new option to run "Script text" instead of a script file. With that option, you don't have to fiddle around with bash -c for running a single command. For your example, just Script text: echo "$PWD" works.

Related

run a bash script from build command of eclipse IDE on windows

I have a C/C++ project which is imported to an eclipse based IDE (STM32CubeIDE) on Win 11.
Inorder to compile the project, I have to enter some commands in git-bash. so for simplicity I wrote them into an .sh which is named build.sh and put it in the project folder, since then I just need to run this bash like this:
source build.sh
in git-bash, and here is its content:
#!/bin/sh
source Q:/stm32.sh
cd Q:/dev/my_project
make build_all
Right now, I want this script to be called, whenever I press the Build button of the IDE.
I found out that for this I have to change the build command from Propertise->C/C++ Build, uncheck the use default build command and then enter the proper command for running the script.
But I could have not do this by now.
I've tried to solve this problem by entering this
${workspace_loc:/${ProjName}/build.sh}
into the build command, which didn't work.
So my question is that what should I enter here to run the build.sh?
Do you know a better solution for my problem?

Terminal command does not work in PhpStorm

When I try to use the command java in the PHPStrom Terminal. I got this error :
'java' is not recognized as an internal or external command
But I checked I added in PATH the environment variable and it works perfectly on a terminal outside PhpStorm.
Why ?
You need to restart the Jetbrains Toolbox to update these commands in terminals.
Close PhpStorm
Right click on Jetbrains Toolbox and click on "exit"
Search jetbrains toolbox in windows to launch again
And all commands work in the Phpstorm terminal.

IntelliJ Terminal CTRL+C does not work

When using IntelliJs integrated terminal - for example with git - sometimes my CTRL + C keystrokes don't make to the terminal. For example the current line is not aborted.
What can I do as this behaviour is very annoying.
As I had git for Windows installed anyway I just replaced the terminal used by IntelliJ from cmd.exe (which is the default on windows) to bash.exe supplied by git for Windows (which is cygwin btw)
To change it for all projects go to File >> Other Settings >> Default Settings and then Tools >> Terminal. (see screenshot)
In the shell path field set the following line:
"C:\Program Files\Git\bin\bash.exe" --login -i
Please make sure git is installed at the proper localtion or adjust the path (for example if you have the 32bit version of git installed)
Using bash instead of cmd, the problem does not occour for me. Plus the bash supports some commands that cmd does not support, which is kinda nice when been used to a linux environment.
EDIT 2020-09-30: In latest Intellij versions the Terminal is a project-level setting and can be changed here:
Sometimes it could be because of vim emulator just turn it off
Go to Tools
Deselect Vim Emulator
Because Vim mode is checked,
Tools, Vim Emulator, there will be a √ in front of it, just cancel it, as shown in the figure:picture
I hope i can help u.

Debugging nosetest test in Pycharm doesn't show output

I'm trying to debug a test using nosetests in PyCharm. I need to stop at a breakpoint and do some interactive debugging using the PyCharm debug console. However, whenever I type anything at the debug console prompt, nothing is printed; I just get a new prompt. The debug console works perfectly with pytest, but I need to use nosetests for this particular test. How can I get the console to work correctly?
Most likely your nose runner suppressing stdout. Try running nosetests with -s
Under the "Tools" menu, select "Edit Configurations." In the dialog, expand "Python tests" and select the nosetests you are running. Add "-s" as an "Additional Argument".
Under the Tools menu, select Edit Configurations. In the dialog, expand Python tests and select the nosetests you are running. On the Configuration tab, under the Nosetests section, make sure the checkbox in front of Params is checked and then add -s as a parameter to it. Apply and Save.

How do I get Netbeans 7.3.1 to see my environment variables on Mac OS X (10.8.3)?

I'd like to run Netbeans from the launcher and get it to see environment variables.
Background:
I'm using netbeans for a rails project and have configured my devel database with configurations using environment variables.
Unfortunately Netbeans appears unable to read those variables even when I list them in /etc/profile (for all users).
I can explicitly run Netbeans from the terminal: /Applications/NetBeans/NetBeans\ 7.3.1.app/Contents/MacOS/netbeans and that gets things to work but I'd much rather run it from
the launcher if I can solve this problem.
You could define them in
/etc/launchd.conf
and restart system. See this for example
If you run NetBeans from the command line, e.g.
open
/Applications/NetBeans/NetBeans 8.1.app/Contents/Resources/NetBeans/bin/netbeans
then the environment variables defined in the shell initialization script will be visible in the NetBeans application. If you start NetBeans via the icon, the initialization scripts are not run.

Resources