ConEmu attempts to open and crashes immediately - windows

I've been using ConEmu x64 on my home computer with Git Bash, and it works well for me.
I recently started a new job and I haven't been able to get them to work together on my new machine.
At first ConEmu would run just fine but wouldn't run git bash, now after a few uninstalls when I try to launch conemu it tries to open and crashes immediately.
Git Bash works on it's own, although it's opening inside MinGW which is different than how it works on my home machine.
I don't know much about the distinction between mingw and git bash but I know mingw comes with git bash on windows.
I'm running Windows 10 on both computers and I've set the corresponding environment variables to be exactly the same using Rapid EE.
How can I launch a bash session within the ConEmu windows, without crash?

Finally fixed my issue - I uninstalled git bash and then the conemu window would stay open. I checked the Settings tab and the terminal was trying to open git bash still, and the path to the file was no longer valid. So after clearing out all the pre-defined tasks, I was able to re-install ConEmu an Git Bash and set the correct path to the git bash .exe. Works just fine now. I definitely appreciate conemu, as a Windows user in a Linux environment it's a super useful tool.

I usually:
unzip https://github.com/git-for-windows/git/releases/download/v2.7.2.windows.1/PortableGit-2.7.2-64-bit.7z.exe anywhere I want,
add the folder to the PATH, and
I am able to call <path\to\git\bin\bash.exe> in a ConEmu session without any issue.

If you do not see "Crash message", than it's improperly to say that ConEmu crashes. If your shell terminates immediately and properly, than ConEmu closes its window by default, and that is normal and expected behavior.
So your question must be rephrased like "Why my bash instance terminates immediately after start". The question does not relate to ConEmu itself.
However, reading ConEmu docs would give you much interesting notes. Especially:
ConEmu -detached
ConEmu -basic
ConEmu -log
ConEmu -? at last!

Related

oh-my-bash not launching at terminal startup

A little while ago I updated to the newest version of bash on my macbook (all went smoothly there,) and decided to try out the oh-my-bash framework. I had previously used oh-my-zsh, so I was familiar with the installation; however, I'm running into an annoying problem with oh-my-bash.
When I open the terminal the framework doesn't launch automatically. It only launches if I run exec bash in the command line. I've checked in system preferences and bash is set as default, and running bash --version confirms that I am running the correct version of bash when the terminal starts up.
It's more of an inconvenience than anything else, but I'm learning scripting and my burning curiosity wants to find the solution. I'm out of ideas short of a fresh install of the framework; what do you guys think?
My solution is this:
Run this code in terminal
mv $HOME/.bashrc $HOME/bash_profile
Restart your terminal
In linux, bash run command file is .bashrc, but in MacOS is .bash_profile.

How to change from MinTTY to Windows 10 default console in Git Bash?

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)

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?)

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.

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.

Resources