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.
While in a command line such as MS-DOS, Linux, and Unix, Ctrl + C is used to send a SIGINT signal, which cancels or terminates the currently-running program. For example, if a script or program is frozen or stuck in an infinite loop, pressing Ctrl + C cancels that command and returns you to the command line.
Then click Command + A or Ctrl + A to select all the text and then click Cmnd + c or Ctrl + c to copy.
Open the Terminal tool windowFrom the main menu, select View | Tool Windows | Terminal or press Alt+F12 .
Opening a Terminal Window We can open the terminal window with ⌥F12 on macOS, or Alt+F12 on Windows and Linux. The terminal supports all the same commands that the operating system supports. and press enter. When MongoDB is running in the terminal session, we can go back to writing the application code in the editor.
Re: [Semi-Solved] Ctrl-C (^C) not working in terminal. Could the Ctlr+C key combination be mapped to something else in the WM? Can you try this from a different WM/DE or maybe even from one of the virtual consoles (Ctrl+Alt+F1) If Ctrl+C works in virtual console or any other WM/DE, then it could be an issue with Subtle WM..
It may depend a lot on whether the program is designed to be run in a terminal or from a GUI. Actually, many programs will not stop on Ctrl+C because all it does is create an exception in currently running thread. Multithread programs as well as programs with "In case of any exception, go on forward."
I'm pretty sure it will kill most terminal programs; of course, it won't kill the ones that fork a new process, then return the prompt immediately. Some programs may catch this interrupt and handle it however they want, or even ignore it. It may depend a lot on whether the program is designed to be run in a terminal or from a GUI.
I've also realised that if I install the IdeaVim plugin and on Settings > Other Settings > Vim Emulator I select Ctrl+C and Ctrl+V to be handled by the IDE then both work. But I don't want to work with this option cause it also changes many other shortcuts I'm too used to them to switch them.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With