Search code examples
intellij-ideaterminal

Clear entered command in Intellij Idea Terminal


I work with Terminal in Intellij Idea and sometimes I find that the command I've just entered should be erased. In Windows or Linux I can use Ctrl+C to clear the command I've just entered, in Idea I should hold Delete or BackSpace to erase it. What is the similar keyboard shortcut in Idea? Or if there is no one by default, can it be set up?


Solution

  • My answer is specific to Windows as I don't have another platform handy at the moment.

    If you open the Terminal tool window within IntelliJ IDEA to use the command prompt, and start typing a command, but realize that your command isn't what you want to do and want to erase it, you can use the Esc key to erase the current line. This isn't really an IDEA-specific shortcut, it's standard within the Windows command prompt.

    If after running a command, you want to clear the commands you've run and their output from the screen, you can just run the cls command, which again is a standard command prompt feature.