Search code examples
visual-studiovisual-studio-2008immediate-window

Visual Studio immediate window command for Clear All


Is there a command to clear the immediate window in Visual Studio?

I hate having to grab the mouse for a right click menu there - would rather just type "cls" or something.


Solution

  • To clear the immediate window, you can use >cls, which is a predefined command alias to >Edit.ClearAll.

    The MSDN article lists all predefined aliases and you can define your own, too. (For VS 2010 and earlier, custom aliases are described in a separate article, though.) Scanning through, there's a whole slew of them, some of which might even have their roots in MS-DOS DEBUG.EXE (specifically >d, >g, >p, >q, and >t come to mind).


    Also worth noting as it's only two keys to press: Context menu > Clear All invokes the same command and it can be navigated using keyboard. Therefore in the immediate window, you can press Context Menu, L.

    If you don't have a context-menu key on your keyboard (you know, the one between Right Alt and Right Ctrl), you can use Shift+F10 instead.