Can Intellij automatically run commands when opening the embedded terminal? - windows

I use the embedded terminal intellij on Windows and I always run a set of commands as soon as it opens. Commands such as setting aliases etc etc. Is it possible to get intellij to run the automatically?

No, it's not currently supported; please follow IDEA-210036 for updates.
Note that you can set up init script in the AutoRun registry value to execute a set of commands on each cmd.exe start - see
How to run a command on command prompt startup in Windows. But this will affect all your cmd shell instances, not just the cmd.exe in the terminal embedded in WebStorm

Related

Using bash in WebStorm terminal

I downloaded git bash for Windows and attempted to set this as the shell in WebStorm. I went to Settings -> Tools -> Terminal, and set the Shell path to git-bash.exe. Then, when I pressed OK an opened the terminal in WebStorm, I got the message:
Cannot open Local Terminal
Failed to start [git-bash.exe] in C:\Users...
Error running process: CreateProcess failed. Code 2
Perhaps I need the environmental variables set up but I wasn't sure how this would be done.
What steps are needed in order to enable this shell in the WebStorm terminal?
Please use full\path\to\Git\bin\sh.exe as Shell path in Settings | Tools | Terminal.
git-bash.exe won't work, because it is a terminal emulator for sh shell with its own window/UI, not a shell. WebStorm provides its own terminal emulator in Terminal tool window. It's impossible to integrate one terminal emulator inside another, because all integration is based on parsing ANSI/VT sequences from underlying shell.

how to create a batch file to execute command in Cmder?

I wanna create a batch file that launch Cmder and then execute some commands inside the Cmder. I know how to launch Cmder using a batch file but don't know, how to write/execute a command in Cmder using batch file.
I tries this...
#echo off
cd "C:\Program Files\cmder"
start Cmder.exe
cd "D:\Path"
Above code launches the Cmder.exe but doen't execute cd "D:\Path" inside Cmder.
You asked how to improve / fix
#echo off
cd "C:\Program Files\cmder"
start Cmder.exe
cd "D:\Path"
There are a few issues that could be better addressed in different ways. but as they appear not to be your real Issue I will simply suggest an alternative way to invoke cmder could be:-
#echo off
start "Cmder" "C:\Program Files\cmder.exe" /START "D:\Path"
I dont have a D drive so accept here my Path is e:\Path and the above command would result in the desired action, like so:-
In comments you explained that was not the intent but to run a cmd within cmder that would start first by changing the start directory.
What users need to acknowledge is that cmder is a very lightweight configuration wrapper around ConEmu and it is there that commands are processed as defaults or "Tasks"
So the request is to start up default Cmder and automatically change to e:\path where I can run further commands. One way to achieve this:-
Is to add my own MyAutoRun Task so I can invoke as
start "Cmder" "C:\Program Files\cmder.exe" /TASK MyAutoRun
Which is stored as a ConEmu Task like this:-
The full but limited range of Cmder arguments can be found at https://github.com/cmderdev/cmder#cmderexe-command-line-arguments
For configuring ConEmu tasks you need to see https://conemu.github.io/en/Tasks.html

Can I add my own executables or batch scripts to the boot recovery command prompt in windows?

when you boot into windows and screw around with the F-Keys until you get to the repair menu, there is an option to run a command prompt. However, I cannot access any of the files on my PC from that command prompt. Is there any way for me to access them or add my own? Thank you a ton.
The cmd prompt
You could access other files, just cd yourself to other drives(you're
defaulted to driveX) – SteveFest
Perfect!

How to set a ready command when opening powershell?

I mainly use powershell to run a server i.e, my first and (mostly) one command is
python manage.py runserver
I seldom have to use other commands.
How can I configure the powershell to open the window with that command. Please note: that I already keep the powershell configured to open in the desired directory.
You can use the PowerShell profile to preload anything useful in your PowerShell session (variables, functions, commands, ...) :
All About PowerShell Profiles

batch file commands in powershell execute in a different command prompt

I'm using this new machine, so as usual I go and set the execution policy so that I can use my profile script, after doing that however powershell now opens all batch files in a new cmd.exe window.
I tried undoing this step but it's still the same so I think it has nothing to do with the script execution policy, also I still have the powershell window in which I originally set the execution policy and this one behaves normally, only new windows have this problem.
I may have installed some software, but nothing is related to windows, and I tried setting the PATH variable to its exact value in the working window but it does not work.
Batch files will open in a new window if the PATHEXT environment variable does not contain '.BAT' as one of the executable extensions.
To check the variable, enter the following at the PowerShell prompt: $env:PATHEXT

Resources