I have oh-my-posh and posh-git installed and added to my Powershell profile, which looks like this
Import-Module posh-git
Import-Module oh-my-posh
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\thecyberden.omp.json" | Invoke-Expression
I'm using the CaskaydiaCove NF font in Powershell, which I also set as the font for the Package Manager Console.
My Windows Terminal prompt is correct:
However, the Package Manager Console in Visual Studio is weird, like it's not able to find the correct glyphs:
Is there a way to fix my Package Manager Console prompt so that either it displays correctly like Powershell, or so that it ignores the Powershell profile and just uses its default prompt?
This is because that shell doesn't support ANSI. Have a look at the PowerShell settings in case this is 7, otherwise there's no fix for it.
Related
I've installed Anaconda for data science onto my computer (http://anaconda.com/) for data science through Python.
as I've gone through the workflows for the course, i encountered issues setting up a virtual environment so I skipped this and used the default environment.
Because of the size of the package, I tried unistalling this using windows Add/Remove programs but now my command prompt is no longer working.
I tried recovering it using powershell but powershell opened with the prompt:
& : The term 'C:\Alan\Python\Anaconda3\Scripts\conda.exe' is not recognized as the name of a cmdlet, \function, script
\file, or operable program. Check the spelling of the name, or if a path was included, verify that the \path is correct
\and try again.
\At C:\Users\Alan Curley\Documents\WindowsPowerShell\profile.ps1:4 char:4
(& "C:\Alan\Python\Anaconda3\Scripts\conda.exe" "shell.powershell" "h ...
+ CategoryInfo : ObjectNotFound: (C:\Alan\Python...ripts\conda.exe:String) [], \CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
indicating that the removal of anaconda and its environments failed and left some stuff behind.
I tried following the link at:
Uninstall Anaconda Completely
to re-install anaconda but because my command prompt wont start it wont run anaconda or conda to install "clean anaconda".
Now I'm down any programs that rely on my command prompt to work and I've no idea where to start - any help?
I found the issue with my command prompt.
After some additional digging into the command prompt and issues with the command prompt, I came across the link:
https://answers.microsoft.com/en-us/windows/forum/windows_10-performance-winpc/command-prompt-in-windows-10-flashes-but-wont-stay/e539c3d2-8b1d-433f-82aa-db3944dae0de
using this, I tried calling the command prompt cmd.exe /d to exclude any autorun operations (Further research:
https://sourcedaddy.com/windows-7/using-autorun-execute-commands-when-command-prompt-starts.html#:~:text=To%20specify%20an%20AutoRun%20value,it%20at%20the%20command%20prompt.
)
and my command prompt worked ok again but not if I called up the /d.
I searched the autorun in the registry and there was a part entry:
"if exist "
I removed the autorun entry from the registry registry completely and i was then able to re-install and de-install anaconda again.
Hopefully it's gone for good this time.
I am using Windows 10.
I have Git Bash (from Git 2.20.1) installed with configuration of using MinTTY as terminal emulator.
I can see that following entry in Git-2.20.1/etc/install-options.txt
Bash Terminal Option: MinTT
This means when I start git-bash it uses MinTTY as terminal - one can see this by right clicking on the title bar of git-bash window.
Now I have to switch to windows default console. When I say "switch" I mean when I start git-bash I expect it to use windows console - I should be able to confirm this by right clicking on the title bar of git-bash window.
Below link explains the difference between MinTTY and Windows console - https://willi.am/blog/2016/08/08/docker-for-windows-interactive-sessions-in-mintty-git-bash/
However I cant find any config or mechanism to change this. (Changing install-options.txt with Bash Terminal Option: ConHost does not have any effect)
And I cant reinstall it as it has came via my organizations packaging system.
Is there any config anyone knows which I am missing?
Appreciate help - Many Thanks !
This switch is a part of git-bash.exe binary. It's only being edited by Git Windows installer hook named edit-git-bash.
You could compile and run edit-git-bash.
Or reinstall Git entirely (simpler)
Anaconda was installed by Systems Team on my work computer.
For reasons beyond this topic, they installed in Program Files, which I think is non-optimal.
So I ask permission to remove the installation and reinstall it via standard procedures.
When I open Anaconda PowerShell prompt it is still pointing to the Program Files installation which I have removed.
I have also checked the Path environmental variable, and there is nothing looking like Anaconda is still there.
How can I get Anaconda PowerShell prompt to work again?
It should be noted that conda command does work in regular command prompt.
Thanks.
Initialize conda for use with Powershell via
conda init powershell
This command should be run in Anaconda Prompt.
Before following #Peter's solution, I was able to track the problem via a more rustic procedure.
Right click on Start Menu's Anaconda PowerShell Prompt, and select Open File Location.
Right click on the icon's Properties, select Shortcut tab > Target field.
Copy the command to a text editor, and noticed it was still using an old location.
Changing the command to point to the right location did fix the problem.
... but that is only the command from the Start Menu, the rest is done by what was suggested before.
Thanks for the help.
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.
I tried some ways with the path thing, but it did not work. When I edit the path in the System variables it opens up all the paths, not like in tutorials, where I should just put the ;%GRADLE_HOME%\bin at the end.
Download Gradle and unzip it to where you want it installed.
Then in Windows Search, search for "System" and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables
Then click New button under user variable and add GRADLE_HOME to variable name and path pointing to the root directory of unpacked files from the Gradle to variable value.
In System variable section select Path and then click the Edit button.
In next window click New button and add path pointing to the bin directory of unpacked files from the Gradle.
If you are window user then Scoop will be the best option to installs the tools you know and love. Scoop is simply a command line installer.
simply run this commandscoop install gradle
But first you need to install scoop using powershell command
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Note: if you get an error you might need to change the execution policy (i.e. enable Powershell) with following command
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
In case you're here and none of these answers "helped", try restarting the shell program.
I just spent more than an hour and I just had to restart my console window to do the trick.
Download Gradle and unzip it to where you want it installed. Then open your USER variables window for your user (similar to what you show) and create a GRADLE_HOME variable with a path pointing to the root directory of your downloaded Gradle distribution. Then add it to the PATH in your USER variables with something like:
%PATH%;%GRADLE_HOME%\bin
Notice that I have prepended the existing PATH variable onto the new one. You don't want to remove what's already there. Also, your image shows something else added to the path. You will want to add that on to the line above, something like:
%PATH%;%YOUR_OTHER_STUFF%;%GRADLE_HOME%\bin
So that it won't be lost either.
This is what I have done on Windows for years. Other options are to use something like http://sdkman.io/; however, that requires extra work on Windows since it's really meant for OSes with a real terminal.
choco install gradle in shell/cmd.
of course, you gotta install the chocolatey first from here
Chocolatey - the package manager for Windows.