I've recently switched from using iterm in OSX to using Cygwin in ConEmu on Windows. One thing I'm really missing is the ability to completely clear the terminal buffer at any time using Alt+k. I've managed to get Alt+k to clear the buffer using a GuiMacro in ConEmu to run the command cmd /c cls using this approach:

ConEmu: Keyboard shortcut to run "cls[ENTER]"

The problem is that because it's a command, it doesn't work when I've just kicked off a process. The same limitation applies to Ctrl+l, which clears the current window but leaves the scrollback buffer in tact. What I'm really after is a way to completely clear the scrollback buffer at any time using a keyboard shortcut. Any ideas?

I'd also be interested to a lesser degree in doing the same thing in bash on linux (as I run it in a VM) and in the regular Windows cmd.exe.

Update: This seems to be possible when using the terminal in my IDE (Intellij), on all platforms. Unfortunately other limitations of running the terminal inside my IDE mean this isn't the solution I'm looking for.

  • Why are you trying to run "cmd" from cygwin?? Ctrl+L clears cygwin screen. At that does not relate to ConEmu at all. – Maximus Apr 6 '15 at 18:12
  • I've had to use cmd to be able to clear the scrollback buffer, I haven't found another way of doing this in Cygwin alone. Or in bash in Ubuntu either, for that matter. – Conan Apr 6 '15 at 18:19

This clears scrollback buffer in cygwin bash

clear

or

echo -e '\0033\0143'
  • OK great, echo -e '\0033\0143' clears the buffer in the same way as cmd /c cls, but is better as I don't need to shell out to cmd. I still can't use it whilst another command is running, however - do you know of a way to make that possible? – Conan Apr 6 '15 at 22:30
  • You must not do that. When another command is running, any significant modification of buffer may damage program output, or even lead to its crush. – Maximus Apr 7 '15 at 6:50
  • 2
    But I've never had a problem with exactly that behaviour in iTerm, where it is standard. I'd like to replicate that useful behaviour on other platforms. – Conan Apr 7 '15 at 7:21
  • 1
    Update: Not sure if this changed recently, but clear does not work (any more?). The echo sequence still does clear the scrollback buffer though. I'm almost sure clear worked until recently, until I installed the latest conEmu update. – Mörre Sep 11 '15 at 14:27
  • Working as expected. – Maximus Sep 11 '15 at 15:18

The developer has addressed this: https://conemu.github.io/en/ClearScreen.html

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.