"Drop Down", Quake-style Command Prompt for Windows




As a regular Lifehacker reader (albeit one who rarely enacts the excellent tips within), my attention was brought some time ago to Tilda.

Tilda provides a drop-down console for *nix-based systems, in a style familiar to players of First-Person shooter games - press the Tilde (~), and the console appears at the top of the screen, ready for input. Press it again, and it disappears. Neat and tidy, easy to use, and extremely helpful.

However. While *nix users get to enjoy such marvels, we who choose to slum on the Windows platforms are left without said nifty gadgets.

Heartbroken, I found myself searching for a solution. Without any coding skills to my name, I needed something easy. So I turned to a couple of Lifehacker favourites to achieve a simple facsimile of the effect.

Disclaimer: As so many budding Instructable authors have said before me - this is my first, so be gentle on my poor ego.

What you will need:

You will need:
- A Windows-based Hotkey-enabler. I chose AutoHotKey, and the following Instructable will be based around that choice. Adjust to taste.

- A Windows-based console shadowing application. I chose Console.

Optional: Cygwin, for that truly authentic *nix flavour.

Once you have collected your components, press onward.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Configure Your Hotkey Mapper, Part 1.

I'm going to - potentially mistakenly - assume that the programs suggested have been installed to your liking in your preferred directories. If you aren't able to install the programs, or you're having issues, check out the forums for the respectiveprograms.

With that out of the way, we are free to begin configuration.

Disclaimer again: I in no way claim to be an expert at either program. What I have put together below is based on a five-minute read of the documentation for the program and having a specific goal in mind. There is, no doubt, more elegant ways to achieve the same effect. I leave this as an exercise for the reader, or pedant, or both.

So. For those eager to achieve the effect, scroll to the bottom of this instructable, download the files, install, and enjoy. But I will, for those with the desire to read further, explain my reasoning and steps.

What we want to achieve, at this stage, is to make the console appear with a hotkey, and disappear with the same hotkey - or, for a little more elegance, the escape key.

I've chosen to use the much-underappreciated Windows key along with the tilde - well, the backtick key, anyway: Win+`.

Let's start simple. We want to launch the console if it's not active, or show it if it is.
IfWinExist [[console]]{	IfWinActive [[console]]	  {			WinHide [[console]]		}	else	  {	    WinShow [[console]]	  }}else	Run [[shortcut to console]]return

Ah, love-er-ly. Pseudo-pseudocode. If it exists (IfWinExist), and it's not active (IfWinActive), make it visible and active. If it exists (IfWinExist) and it's active (IfWinActive), then hide it. If it doesn't exist, Run it.

Okay. Problem: We don't know what (console) should be.

Good point. AutoHotKey needs to be able to refer to the Console application somehow. We need to uniquely identify a session of Console, so we can work with it.

AutoHotKey includes a program called AutoIt3 Window Spy. Basically, this allows us to get the information we need about Console.

Step 2: Sideline: AutoIt3 Window Spy

It's not my intention to create an Instructable about Window Spy. But, quickly, here's how to use it to find the class details about your Console window. For more, check out the AutoHotKey Documentation.

First, launch Console.
Second, launch AutoIt3 Window Spy.

Then, with both open, select your Console window to make it active.

Window Spy will display a significant amount of detail about your Console window. The bit you need to know is the Window Title and Class section, specifically the Class - the line beginning with "ahk_class".

In this case, the line we need is:
ahk_class Console Main Command Window

You can make AHK more selective by using the title; that's, again, an exercise for the reader.

Step 3: Configure Your Hotkey Mapper, Part 2.

After our little tryst with Window Spy, we now have the information we need to complete our script, right?

Let's try again:

#`::IfWinExist ahk_class Console Main Command Window{	IfWinActive ahk_class Console Main Command Window	  {			WinHide ahk_class Console Main Command Window		}	else	  {	    WinShow ahk_class Console Main Command Window	  }}else	Run [[shortcut to console]]return

Okay; that should work, right?

Not quite. It's good, but it's not right. Yet. We have a couple of issues outstanding.

When you run the script, and press your hotkey, you'll notice that Console launches. Another press - it disappears. Great!

Not really. Press it again - and it launches another session of Console! That's not right, is it?

Issue 1: Hidden Consoles stay hidden
So, we're losing the script at "IfWinActive" - it can't find the hidden Console!

AHK has a command for that - DetectHiddenWindows. Let's add it now.

#`::DetectHiddenWindows, onIfWinExist ahk_class Console Main Command Window{	IfWinActive ahk_class Console Main Command Window	  {			WinHide ahk_class Console Main Command Window		}	else	  {	    WinShow ahk_class Console Main Command Window	  }}else	Run consoleDetectHiddenWindows, offreturn

Run it again. This time, it'll hide - but, hmm... it won't come back!

Issue 2: Hidden Consoles really stay hidden
What's happening here is, the console is hidden by WinHide, but it's still active. We need to move the focus somewhere else, so that the IsWinActive call won't return true. The easiest place to send that focus is to the Windows Taskbar.

#`::DetectHiddenWindows, onIfWinExist ahk_class Console Main Command Window{	IfWinActive ahk_class Console Main Command Window	  {			WinHide ahk_class Console Main Command Window			WinActivate ahk_class Shell_TrayWnd		}	else	  {	    WinShow ahk_class Console Main Command Window	  }}else	Run consoleDetectHiddenWindows, offreturn

Close, but no cigar! It comes back, but it's not active - you can't just start typing!

Issue 3: Home movie effect - Console hasn't got focus!
Easy. We'll just make sure that when we show it, we give it focus straight away.

#`::DetectHiddenWindows, onIfWinExist ahk_class Console Main Command Window{	IfWinActive ahk_class Console Main Command Window	  {			WinHide ahk_class Console Main Command Window			WinActivate ahk_class Shell_TrayWnd		}	else	  {	    WinShow ahk_class Console Main Command Window	    WinActivate ahk_class Console Main Command Window	  }}else	Run consoleDetectHiddenWindows, offreturn

It works! Except... we can't close it with escape. That's the icing on the cake.

Issue 4: No way out!
This is just a matter of adding a quick second script to the end of your .AHK file:

#IfWinActive ahk_class Console Main Command Windowesc:: {   WinHide ahk_class Console Main Command Window   WinActivate ahk_class Shell_TrayWnd }return

Simply: if we're in Console, escape hides it. Done!

So - that's it for the AHK file. But your console window is still appearing in the middle of the screen - not very Quake-like. Let's fix that.

Step 4: Skin Your Console

So, now the finishing touches. Again, like AHK, there's any number of ways to customize Console to your liking; check out the readme.txt file in your Console directory to find out more about the XML syntax Console uses.

However: here's how to create the drop-down effect: we want something borderless, semi-transparent and top-left anchored.

Here's the console.xml file I used for this effect.

<?xml version="1.0"?><console title="dropdownconsole" change_refresh="5" refresh="100">   <font>      <size>10</size>      <bold>false</bold>      <italic>false</italic>      <color r="255" g="255" b="255" />      <name>Lucida Console</name>   </font>

The size and width of the font affects the eventual width of the console. Unfortunately, Console - like the Windows console - can only be so wide. Choose a wider font to achieve a wider console.

Personally, I had issues with proportional fonts (ie: fonts with variable-width letters, like Arial); stick with Monospaced fonts such as Lucida Console for best effect.

   <position>      <x>0</x>      <y>10</y>      <!-- dock to top left for "quake-console" feel -->      <docked>top left</docked>      <snap_distance>10</snap_distance>      <!-- float on top -->      <z_order>on top</z_order>   </position>

The top-left docking and the on-top z_order are what give the appropriate feel, here. Play around with these values to change the look-and-feel of your console.

   <appearance>      <hide_console>true</hide_console>      <border>none</border>            <!-- move text away from the outside edge -->      <inside_border>10</inside_border>      <taskbar_button>tray</taskbar_button>
Set border to none to hide the Windows border and make the window chromeless, for a seamless feel.

The inside_border is a personal taste, as is the taskbar_button. The former moves the console's text away from the outside edges, and the taskbar_button makes a Console icon appear on the taskbar when it's active.
      <size rows="18" columns="95" buffer_rows="500" />      <transparency alpha="200" inactive_alpha="100">alpha</transparency>      <background>         <color r="0" g="0" b="0" />         <image style="center">dark.png</image>      </background>
Columns and Rows govern how many lines/columns of text your console can display. Again, this is a personal taste; set columns to "max" for Console to ... erm... set the width to the maximum.

The alpha and inactive_alpha transparency is, again, a matter of personal taste. Closer to 255 is more opaque; closer to 0 is more transparent.

I've chosen to put an image behind my console; the sizing of this image, however, is a little bit of guesswork unless you know the letter-sizes of your chosen font; then, simply, multiply out by the rows and columns and come up with an appropriate size. Quake console, anyone?
      <scrollbar>      	<color r="0" g="0" b="0" />        <style>flat</style>      </scrollbar>
Self-explanatory; this sets how the scrollbars are coloured and displayed.
      <cursor>         <color r="255" g="255" b="255" />         <style>fading block</style>      </cursor>   </appearance>   <behaviour>      <!-- keep the console in place -->      <mouse_drag>false</mouse_drag>      <copy_on_select>true</copy_on_select>   </behaviour></console>
Mouse_drag prevents you from picking up the console and moving it around. Copy_on_select replicates the *nix select-to-copy functionality, for a more *nixy-feel.

The final step is to save all this as an XML file, typically in your Console directory. You can then refer to it directly in your AHK script, or, as I've done, create a shortcut in your path somewhere - called "console" - that passes the XML file as a parameter; then point AHK to that.

Extra Credit
For those truly in search of a *nix experience; you can install Cygwin, and direct Console to use the Cygwin Bash environment as your primary shell:

<console title="dropdownconsole" change_refresh="5" refresh="100"    shell="c:\cygwin\cygwin.bat">

Extra-Extra Credit

Run both Cygwin and Windows cmd with two different hotkeys! That, I'm afraid, is an exercise for the reader...

Be the First to Share


    • CNC Contest

      CNC Contest
    • Teacher Contest

      Teacher Contest
    • Maps Challenge

      Maps Challenge

    33 Discussions


    8 years ago on Introduction

    Added show/hide animation. I'm sure it could use some cleanup and optimization since I just picked up AHK scripting



    9 years ago on Introduction

    I've augmented the AutoHotKey script to automatically navigate to the currently open explorer window's path.  Grab it here.


    10 years ago on Introduction

    DoEs this work with command prompt portable? Would be cool if I could put it on my USB.


    10 years ago on Step 4

    Actually, you can make Console wider. I used:
    <size rows="25" columns="160" buffer_rows="500" />
    to make it similar to Yakuake. It fits quite well on my 1280px wide screen.

    That said, thanks a lot for the instructions! Transforming my Windows into Linux has been my lifelong dream.


    10 years ago on Introduction

    finally! I've been loogking for the 2 things this instructable provides: a transparent console window and one that appears with a shortcut. hell you even got it in the top-left, which for some reason looks better than any other placement I tried. plus its a good resource for learning about autohotkey and console.


    11 years ago on Introduction

    sorry about that it was a directory problum managed to fix it ps super grate instructabule


    11 years ago on Introduction

    first off this is a grate instructable very good and very informative i copyed and pasted all the commands and script it was all working perfectly :) . but suddeunly for some strage reson it started comeing up with a new window error :failed attempt to launch program - -> 017 run,console if i open up the consle manuly it has no problum hiding and showing the window but for some reason it cant "wont" open the console hope you find a way if not no biggs


    11 years ago on Introduction

    On Tue, Jul 8, 2008 at 10:23 PM, Srivathsan V. Canchi wrote:

    Hi Adam,

    Thanks very much for posting your distro of Quake Console. I am sure it is gonna rock, only thing, I am not able to get the ZIP file in one piece from rapidshare (The zip is always corrupted) :-(

    I used the link in your post - http://adamisageek.tumblr.com/post/27245663/quakeconsole. Is there another place from where I can download your QuakeConsole?

    Thanks in advance!


    Hi Srivathsan,
    I am currently working on a second release of QuakeConsole with a few improvements over the old version.
    I can't tell you why the previous version is not working correctly for you, it works fine for me, I just downloaded it, unzipped it, and used it fine.
    I can tell you that the new version will be available for download from my personal website and blog:
    Sadly, the project is very close to completion, but my spare time to work on it is minimal to non-existent at the moment so I can't give you an accurate date it will be done just yet, sorry.
    I will gladly let you know via email once it is finished and ready for downloading!
    There will also be a post made on the blog for the release.

    Note: I apologize for the lack of recent updating to the blog, as I said before, personal time is at a minimum right now :( I hope to devote more time to the blog soon :D

    Thx for your interest in QuakeConsole and I hope you enjoy the new version once it is released.

    Adam _


    11 years ago on Step 4

    There are a new and better console(console2) version, with tabbed interface and others.
    I customise the script , for console2 and make a QuakeConsole.xml with cmd, powershell, bash,.. predefined tabs.
    Console2 + QuakeConsole.ahk and precompiled EXE + Script for make startup shortcut:


    11 years ago on Introduction

    It's actually pretty easy to change this to another terminal if you like. I use puttytray and it's as simple as changing the program the script loads. I used GeekyAdam's script and tweaked it a bit to my liking.


    11 years ago on Introduction

    Hey I created a clean .zip file containing the Console program and a compiled version of working AutoHotkey script, much like BlueForce's except that it doesn't install anything to the registry, and the script restores focus to the previous program used after it hides, much like DukeSucks's idea, but it also reacts correctly if you pressed tilde while the taskbar has focus.<br/>Check it out here:<br/><a rel="nofollow" href="http://adamisageek.tumblr.com/post/27245663">QuakeConsole</a><br/>


    11 years ago on Introduction

    Is there a way to make the window slowly drop from the top of of the screen instead of appearing instantaneously?


    12 years ago on Step 4

    I'm a little confused here: "The final step is to save all this as an XML file, typically in your Console directory. You can then refer to it directly in your AHK script, or, as I've done, create a shortcut in your path somewhere - called "console" - that passes the XML file as a parameter; then point AHK to that." Could you please be more specific about this? So I save the file as cosole.xml and put it in the console's directory. What's next? How do I link it so that it appears as in Quake? Thank you in advance

    3 replies

    Reply 12 years ago on Step 4

    Basically, there's two ways to work with a console XML file. If you save the file in your Console directory (say, c:\program files\console) as "console.xml", Console should automatically load it when it runs.

    If you save it as something else, say "console1.xml", you'll need to tell Console to choose that XML file when it runs. You do that by passing the name of the file to console.exe. For example, you'd create a Windows shortcut to:

    c:\program files\console\console.exe console1.xml

    Putting the XML file into Console only makes Console look like Quake; you then need to use AutoHotKey as outlined above to make it appear when you press Win+Tilde.




    Reply 12 years ago on Step 4

    I tried doing this but it doesn't seem to work with Console2. Any ideas?


    Reply 12 years ago on Step 4

    Great work! Isn't it funny, authoring something; it's always tough when figuring how much to assume one's audience will already knows--and how to best avoid treating them like n00bs vs assuming they all know this stuff.


    12 years ago on Step 4

    ended up doing it a different way. took all the files that came with console and put them in system32 directory. used the autohotkey.ahk and put that file in the startup folder. now when i press "win+` " console runs. the only problem i had was exiting and starting console repeatedly. when i did that it would pop-up at different points on the screen so in settings i turned on docking top-left. now console starts in the same place everytime.

    Just to clarify...you dont need to press " WINDOWS KEY + ` " like the tutorial shows. You only need to press the " ` " key.