IntelliJ Terminal CTRL+C does not work - windows

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.

Related

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

Embed Cygwin (Git Bash) Terminal in CLion On Windows

I am trying to embed the Cygwin terminal in CLion like the default Windows CMD is above.
I have set the Cygwin terminal location as above in the settings.
But when I select the terminal it pops up a detached version as above. What I want is it embedded like the first image.
I have managed to get an embedded version of Git Bash working in PHPStorm using some flags, but these do not seem to work for Cygwin.
Any help is much appreciated :)
The "Shell path" setting expects a path to a shell, not a terminal emulator. Please try specifying a path to bash.exe instead of mintty.exe.
If you've managed to embed the Cygwin terminal in CLion on Windows, but the commands like ls -l, etc. won't work, try to add the path to the directory "bin" of cygwin (e.g. C:\cygwin64\bin) to the path-variable.
https://yichaoou.github.io/tutorials/software/2016/06/28/git-bash-install-gcc
This should work.
X:\Git-Install-Dir\Git\bin\bash.exe works for me.

ConEmu attempts to open and crashes immediately

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!

SVN 1.8 defaulting to non-interactive

I'm using the Windows SVN 1.8 command line client that comes with TortoiseSVN through Cygwin. Right now, it doesn't do any interactive prompting because it doesn't see Cygwin as a terminal device. As in the help for --non-interactive: do no interactive prompting (default is to prompt only if standard input is a terminal device). If I pass in --force-interactive, the command hangs.
Is there a way that I can make SVN see Cygwin as a terminal device?
NOTE: I edited the question from my original post because I foolishly assumed --force-interactive worked in this scenario. I've narrowed it to the root of the problem.

Resources