Wednesday, 25 July 2007

My Windows Shell

QuickShell is my first attempt at writing a shell for Windows (using the console API). Originally I was planning for it to replace the infamous cmd.exe (at least among many users of Unix shells), but since PowerShell has been released, I've been continuing it mainly because of my fondness for CLIs. In addition, perhaps it may turn out to be quite useful as a management console for one of several possible future projects (after a bit of adaptation, of course).

I've linked to my demo release at the bottom of the post, with a brief description of some of the features. No installer will be required to run it, since I want to keep the whole thing as lightweight as possible - just unzip and run the shortcut. At the moment, it has a rather short feature list, but I've already added a few handy things, primarily tab and double-tab completion, which I explain in my release notes. It generally has an interface more similar to PowerShell rather than cmd.exe (in fact I tried to make it look and feel as different from cmd.exe as possible). Still, the CD and DIR commands are built in, and also registry browsing alongside the usual filesystem browsing, a great little feature that I again copied from PowerShell. To sum it up: the framework and UI is there, alongside the start of a command system, but you'll have to wait a bit longer for the interesting parts.

Of course, since I'm writing it, the whole thing is in .NET. Apart from VB.NET & C# being the only real languages I know well, it does offer the great opportunity to add .NET-style scripting, something that could really enhance the power of the shell. Aside from that, I've had to dig into some MSDN documentation a bit to access some of the lower-level console functions (which can be used alongside the built-in Console class), but overall .NET really isn't throwing up any big protests.

Given a bit more solid progress on the shell, I am hoping to start up a small CodePlex project quite soon. For the moment, however, you'll have to make do with only binary releases.

Release v0.1.0
The first demo release is now available here for download.
Download, extract to any folder then place the included link somewhere convenient (or leave it in the same folder). Either way, you'll have to change the Target property of the link to point to wherever you unzipped the EXE - I recommend you don't run the EXE straight simply because the link has some configuration that makes the console look and feel a lot better. Thanks to Windows for not supporting relative links...

A few things to note before you use it:
  • Registry can be browsed by specifying an absolute or relative path with the CD command, such as HKLM:\Software. The DIR command is also available for browsing the registry, but tab completion is not yet implemented.
  • To run a program, just type it's name (with or without the EXE extension). The shell will search the path environment variable for any executables with the name, and if none are found it will try to run it from the current directory.
  • Up/down arrows allow you to scroll through command history.
  • Pressing the Tab key while typing an argument will complete the argument as far as it can. If there is still any ambiguity in the text of the argument then the console will beep. This is currently implemented only for the CD command, but the generic framework allows for application to any command.
  • If the console beeps after the first Tab to indicate that the text of the argument is still ambiguous, then you may press the Tab key again to print out below a list of all possible values for the argument. The current command line will be retained.
  • In addition, pressing Ctrl+R whilst typing an argument will cycle through all the possible values that match what you had typed
  • Other basic commands that have been implemented are: exit, clear.

No comments: