Adding new terminal shell to VS Code - terminal

I downloaded the cmder shell and would like to integrate it with VS Code and use it as one of the terminals.
In VS Code, when I go to View->Command Pallette, and then type Terminal: Select Default Shell, I am promoted with a drop-down list that looks like the following
I would like to have a fourth option, for Cmder. So the list would include "Command Prompt, PowerShell, Git Bash, and Cmder". How do I add this option?
Thanks.

You can follow below link :
https://code.visualstudio.com/docs/editor/integrated-terminal
You need to edit the terminal integrated path in settings.json file to which ever thing you want it to compile it with

Related

Its possible to change the "webstorm" shell command to open a file in WebStorm?

I open files in WebStorm from the terminal with the command webstorm . when I'm working in a directory.
Is there a way to change the command webstorm to anything more, like wstorm or something shorter to open files fluently?
I'm using macOS.
I Know one way but it's temporary, works untill you close the terminal.
-in your terminal
W=webstorm
then you can use $W in your command instead of webstorm.
Looks like the hint above is very good.
So assuming the shell script "webstorm" is working and your question is how to modify the command AND you want to do it fluently.
Make an alias (your shell may vary, mine is bash)
in the appropriate 'dot' file for your shell
add an alias for webstorm -e like this
alias we='webstorm -e'
now when I want to open a file quickly I type
we filename
And this opens Webstorm in LightEdit mode which opens faster and has a link to access full IDE.
Works like a charm. Also, you could make more than one alias so say ws for the full ide. Enjoy

How can I use a git bash terminal profile in Visual Studio 2019?

Visual Studio 2019 has recently added a new (much-needed) terminal feature in its 16.6 version.
It's really great, but I'm having a hard time integrating git bash in the profiles.
I've tried a few variations of arguments and whatnot of the following profile:
But whenever I try selecting that profile, the terminal shortly displays a blank screen, then opens the default PowerShell terminal.
What am I doing wrong and how can I configure the profile correctly?
In case you haven't figured it out already: You need to add argument -i (to make the shell interactive), and I also recommend --login (to make the shell read default profile configuration files).
Try adding the following in the Arguments field:
--login -i
I used C:\Program Files\Git\bin\bash.exe as the Shell Location, and it worked fine.
Solution I am using while waiting for a better one:
Shell Location: C:\WINDOWS\system32\cmd.exe
Arguments: /k ""%VSAPPIDDIR%..\Tools\VsDevCmd.bat" & bash"
Essentially, I am launching cmd and running the "bash" command at launch, effectively nesting the bash terminal within cmd.
My Workaround:
What you no one mentioned in all of these replies is that you need the shell not the executable different things...
Shell Location: C:\Program Files\Git\bin\sh.exe
Arguments: (If you have any preferences add here, it works without)
And...
Walah!

Change default terminal app in Visual Studio Code on Mac

I want to change the default terminal app used by Visual Studio Code for Mac. I am thinking it is part of preferences or settings json, but unsure.
Here's an example of how to make another terminal the default for VSCode, in this example I've downloaded iTerm2 and copied iTerm2 to Applications.
Code (Menu) > Preferences > User Settings
Edit settings.json "terminal.external.osxExec": "iTerm.app" and "terminal.explorerKind": "external"
Open in Terminal
iTerm is now default terminal launched from VSCode
For those that want to change the default integrated terminal NOT just the external, and add custom themes, show which git branch you are on, and whether or not files need to be staged or committed for example.
Follow these short steps:
Make sure you have these installed:
iTerm2, oh-my-zsh
Install a powerline font (I am using Menlo which is a nice looking and very popular font).
Go here and click on download
Open the file
Click on install font
(Note: without this, vscode integrated terminal will not render themes correctly)
Open the .zshrc file by running this command:
cd ~ ; code .zshrc
Change iTerm's theme to agnoster:
Press ⌘f to open search in the .zshrc file
Type ZSH_THEME
Search until you find the live code, NOT the commented out code :)
Edit the code it so it looks like ZSH_THEME="agnoster"
Save the file
Open vscode settings using shortcut:
⌘,
Inside of vscode settings, you will see two panels. On the right panel paste this:
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Menlo for Powerline"
Assuming the settings were empty before, it should now look like this:
{
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Menlo for Powerline"
}
Finished! Enjoy your new pimped out terminal
-(Optional customization)-
If you want your prompt to display something other than your username such as a thunder bolt, like in mine or anything you want
Open agnoster theme by runnning this command:
cd ~/.oh-my-zsh/themes/ ; code agnoster.zsh-theme
Open search by pressing:
⌘f
Paste this in search bar:
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER#%m"
To change your what your prompt displays, edit ONLY this part:
$USER#%m
DO NOT CHANGE this part:
prompt_segment black default "%(!.%{%F{yellow}%}.)
In conclusion, the code should now look something like this:
prompt_segment black default "%(!.%{%F{yellow}%}.) Insert here whatever your heart desires"
(Note: Technically you can change everything about your terminal prompt, but for the sake of keeping this short, and simple we only edited the username part)
None of these answers fully worked for me. Here is what I changed to get it to work:
Select the default shell as zsh:
CMD + SHIFT + P to open up the command palette. Then type Terminal: Select Default Shell. You can then select zsh.
Change the terminal to use iTerm
Change the font family to use Powerlevel10k
Result
I recently changed my terminal in VSCode to ozh, its just 1 step and 1 line.
Open Command Palette using View > Command Palette
( or simply Command + Shift + P )
add the following line to the user settings.
"terminal.integrated.shell.osx": "zsh"
well I know it's so late, but you could just change it by running command
Terminal: Select Default Shell
its so much easier
From visual studio code blog:
// 64-bit cmd it available, otherwise 32-bit
"terminal.integrated.shell.windows":"C:\\Windows\\sysnative\\cmd.exe"
// 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows":"C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
// Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
// Bash on Ubuntu (on Windows)
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
Reference: Integrated Terminal
In vscode settings.json add:
"terminal.integrated.profiles.osx": {
"zsh": null
},
No. But you can vote for this feature here: https://visualstudio.uservoice.com/forums/293070-visual-studio-code

why can't I run this exe file from the command prompt?

My file's path is D:\installed software\Wing IDE 3.2\bin\wingide.exe.
Now I want to run the wingide.exe file on the command line. So first, I enter cmd to the startup box, then get C:\Documents and settings\Administrator>
Then I typed d: then installed software\Wing IDE 3.2\bin\wingide.exe after it. and click the enter key. It shows D:\installed is not an command. Why? How can I correct this?
The Windows command prompt (I hope you are not actually using MS-DOS!) does not care about what keys you've typed. It cares about the command you are attempting to run and it seems it's this:
installed software\Wing IDE 3.2\bin\wingide.exe
So you are asking to run program "installed" and pass three parameters to it:
software\Wing
IDE
3.2\bin\wingide.exe
... because that's how most command prompts work: you use white space to separate items. You probably want this:
"installed software\Wing IDE 3.2\bin\wingide.exe"
or:
"D:\installed software\Wing IDE 3.2\bin\wingide.exe"
Your path has a space in it so you need to put quotes around it. Try typing:
"D:\installed software\Wing IDE 3.2\bin\wingide.exe"
Type:
"D:\installed software\Wing IDE 3.2\bin\wingide.exe"

Does netbeans support coloring for .sh (bash) scripts?

I use netbeans 6.8 beta and when i load .sh (bash) file it's not colored at all. i can add a new file association for the .sh extension but it doesn't seem that there is a known associated mime type.
I have not tried this myself but you can get shell script support in Netbeans if you install the C/C++ plugin.
old question, time for an update (tested for 8.0.2,8.1,8.2).
Here's what worked for me
Install C/C++ plugin.
This will recognize .sh extensions as bash files
Install nb-noext-mime-resolver (for 8.2 you'll find it as No Extension MIME Resolver) . This will add support for files with no extension by recognizing the shebang line
Go to tools/options/editor/spellchecker and uncheck 'Script and make comments'.(not available after 8.2) This will get rid of the red squiggly lines that appear under 'usr' and other legitimate notations in the shebang line and elsewhere.
You'll get full syntax highlighting as well as the ability to right click and select 'run' which will launch your script in the built in terminal. very nice.
To get the context menu 'run' to work with your shell
Select 'Run'/'Set Project Configuration'/'Customize'
Click 'New' and add a name for your shell like 'bash' or 'cygwin'
Select 'Run As' 'Script (run in command line'
Where it says 'Php Interpreter' (or equivilent) add the path to your bash shell. e.g: C:\cygwin\bin\bash.exe
Click 'ok'.
Also, check out the properties of the bash files and you'll find some helpful ones.
This is very odd. I have NB6.8beta installed with the C/C++ plugin. When I open a .sh file I do see syntax high lighting. Quotes strings show up in orange, commands are in blue.

Resources