Re: cmdEX.exe - augmenting the existing CMD.EXE
From: Stuart Carnie (stuart_carnie_at_hotmail.com)
Date: 08/24/04
- Next message: cli_happy: "Re: Get today's date no matter what format is in use."
- Previous message: Bill Stewart: "Update: Batch Scripting Toolkit 1.1"
- In reply to: Ndi: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- Next in thread: Ndi: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- Reply: Ndi: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Aug 2004 14:18:11 -0700
There is going to be a myriad of ways of implementing the plugins...
I have been reviewing the code, and I expect I'll provide some COM
interfaces to get to the edit buffer. This will make it easy for code
written in Delphi, C++ or .Net to interact with the environment.
I envisage providing a simple interface to an 'device' that abstracts it
from the underlying I/O device for drawing simple popup boxes, drawing text,
receiving input, etc. The reason for this is I have also hooked all the
console output APIs, so we can redirect this anywhere, in real time.
As an example, by providing your own implementation of this abstracted
device, the console could be redirected to a Unicode graphical shell.
There will be a few different 'layers' of plugins..
Shortcut - your plugin will bind to a key combination to perform some
action in the console. This could be as simple as inserting some text to as
complex as you want to get.
Completion plugin - (typically bound to the TAB key) this plugin will
provide extended command line completion for the current context. Not
entirely sure of the implementation details yet, but I see this operating
two ways.
Firstly, your plugin registers itself against a command, such as the
ROUTE command. Lets go through a use case
Now if you type ROUTE on the command line and press TAB, your plugin
will cycle through the keywords 'PRINT, DELETE, ADD or CHANGE'. Much more
intelligent than cycling through the current directories or files. zsh can
do this. Now, we stop on CHANGE and press the TAB key again. A standard
'list' text dialog pops above or below your command line, and highlights the
first IP in the ROUTE table, and as you continue to press the tab, it
changes the selection. How cool is that?
I want to come up with a generic way for plugins to be able to be
given the current context, and a way of returning the appropriate options..
There is so much that could be done with this...
NET START is another good example - imagine getting a list of the
services available and selecting the one you wish to start.. Very
productive..
The other option is the plugin registers for ALL completions, and
must parse the commandline itself to determine context and the appropriate
input.. Much more involved.
This is not to be confused with the extensions ability to do basic
completion. Like zsh, you can register simple context sensitive completion,
where it just selects from a list of available switches. I expect to add
this also, but it will not be able to discover dynamic content.. ...unless
we allow you to script it in some way to parse out stdout :)
Anyhow, enough for now :)
It will probably take a couple of weeks to get to the basic shell, but it
has a lot of potential I think.. As long as Longhorn has the same kernel32
APIs (which is almost guaranteed for backwards compatibility), this should
work with msh / Monad too!
Cheers,
Stu
"Ndi" <NoSpam@Ndi.ro> wrote in message
news:OzzuDrhiEHA.3612@TK2MSFTNGP12.phx.gbl...
> Compiler? Version?
>
> As a developer, I was thinking about a DLL export or import that would
> allow people with different compilers/version (say ... Delphi?) to add
code
> to them.
>
> Perhaps an addon system would be great. Like the user adding his own dll
> to a list (ini file?) and publishing events to be called (Init,
KeyPressed,
> LineChanged, etc). That would allow people (like me:) to add their own
> functionality (which would spare you the trouble of me bugging you to
"bind
> me this to that". STDCall undecorated functions would be just perfect ...
>
> I currently use a service in background that binds keys to applications
> (and globally) and I use that to make my day (like Shift+PgUp and PgDn for
> console scroll, a Unix feature that is *really* useful). However, enhanced
> functions from outside the shell are a complete pain since it takes some
100
> lines just to get the window, buffer, scroll positions and such. You can
> imagine what Shift+arrows selecting can do to code... Also, you need to do
> that only when in command input mode, otherwise you grab critical input
from
> DOS and console applications.
>
> --
> Andrei "Ndi" Dobrin
> Brainbench MVP
> www.Brainbench.com
>
>
- Next message: cli_happy: "Re: Get today's date no matter what format is in use."
- Previous message: Bill Stewart: "Update: Batch Scripting Toolkit 1.1"
- In reply to: Ndi: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- Next in thread: Ndi: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- Reply: Ndi: "Re: cmdEX.exe - augmenting the existing CMD.EXE"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|