Prevent git-bash to open in new terminal - windows

I am running a sh script in VSCode, using Windows environment. When i run the .sh script from the internal VSCode terminal, it opens a new window from git-bash.
The problem is that inside the .sh there is some Docker commands that aren't recognized inside the git terminal, only outside, like running in integrated console from VSCode, in PowerShell.
How do I prevent to open this windows and allow the execution of these scripts inside the integrated VSCode console?

Related

JetBrains Rider new bash terminal in working directory on Windows with WSL

Using JetBrains Rider an Windows 10 with Ubuntu in the WSL.
When i use the Windows cmd.exe as shell path for the integrated terminal in Rider im starting in the current directory of the open solution/folder.
If i use ubuntu2004 as shell path i start a bash. But the directory is always home/"Username". And i have to change it manually.
Is there a way to start the terminal/bash with the current directory.
Using "wsl.exe" as shell path let the terminal start in the current directory.

Have WSL shell open to project directory in Windows Visual Studio Code

I have a windows subsystem for Linux Installed on my computer and am using it as the integrated terminal on Visual Studio Code. Every time I open a terminal however, it opens in the root directory rather than the current project directory like other terminals do.
Does anyone know of a fix for this?
I have tried messing with the Cwd of the integrated terminal settings but haven't had any luck.
Try using wsl.exe as the command for shell.
"terminal.integrated.shell.windows": "wsl.exe"
I know that is very late for this answer, but for me it just worked.
I put exactly as above and it launched in my home directory (that is /mnt/d/Users/Adrian).
I have the user setup of VSC, 1.30.1 and launch it from the Desktop shortcut.
After I configured terminal as wsl I go as below:
If I open a cmd windows I can launch it with code . it will launch in Windows home directory.
If move to some other folder (e.g Documents) and launch it with code . the bash will launch to that folder.
Otherwise I can launch it with code D:\Users\Adrian\Documents\VSC and the bash terminal will launch in \mnt\D\Users\Adrian\Documents\VSC
Tested the change both via menu File->Preferences->Settings and with Ctrl+Shift+P (Command Pallete), Terminal: Default Shell.
Tried with bash and wsl.
Maybe you have some other bash installed in the path? (e.g. git bash or MinGW bash?)

Anyway to use the Ubuntu Bash shell in VSCode for Integrated or External Shell on Win10?

If I open a command shell (e.g. Win-X,c) I can type "bash" and open a Bash Shell. But when I try to configure VSCore to use bash.exe (in /Windows/System32) as the shell command it says it can't find it. I suspect it's the Electron security context, but I wonder if I'm missing a way. Here's what I've tried in my settings.json:
{
...
"terminal.external.windowsExec": "C:\\Windows\\System32\\bash.exe",
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe"
}
Any clues?
Assume you have Developer Mode turned on in Updates & Security, For developers. Then go to Programs and Features in Control Panel, Turn Windows features on or off, and tick Windows Subsystem for Linux (bets). Restart. First time you hit yor bash configured terminal from VSCode, it will prompt you to install Linux for Ubuntu on Windows. Then login when prompted or create new username/password.

Can IntelliJ run gradle task via bash.exe rather than Windows cmd.exe?

I use IntelliJ to launch a gradle build task for my project, but it seems that IntelliJ is using the command prompt (or cmd.exe) to launch the gradle wrapper, because during my build I'm getting the error:
'cp' is not recognized as an internal or external command,
operable program or batch file.
I have git bash installed, and running gradlew build from my bash shell succeeds without any such errors.
Is there a way to tell IntelliJ to use my bash executable to run gradle tasks rather than the default Windows cmd.exe?
I tried changing the default IntelliJ terminal (File->Settings->Terminal) from cmd.exe to my bash.exe, but that didn't work.
I solved this problem by first opening a Git Bash, and then running IntelliJ from there. The IntelliJ terminal is then automatically set to a Bash terminal, and all of the great Bash commands are available to Gradle.
If you want the Git Bash window to close automatically after starting IntelliJ, try running this command from PowerShell:
& git-bash.exe -c 'cmd //c start idea64.exe'
I use the Bash for Windows terminal in Intillij by setting the following as my default terminal.
cmd.exe "/K set LINES=9999&C:\windows\system32\bash.exe"

Run Terminal or Script on Startup in NetBeans

I want netbeans to automatically opens terminal,
maybe run some shell script, watch some files with Compass.
Is this possible and how?
This could be a duplicate of: Run terminal command on startup of netbeans in mac osx
It might be your best solution, just writing a script that runs another script, and then opens Netbeans, or vice versa.

Resources