Menu

Generic Console?

Matt
2003-05-20
2003-06-03
  • Matt

    Matt - 2003-05-20

    How would I go about altering the code in order
    to not emulate the command prompt?  I would like
    to have a console that executes commands
    that I define but similar in style to the command
    prompt.  I would like to write modules that
    extend the functionality of this console in order
    to have an extended set of features such as maybe
    controlling winamp from the console based on
    commands or even a module for displaying a
    webpage in pure text.

    Any help on this would be appreciated.

     
    • Anonymous

      Anonymous - 2003-05-28

      What do you mean, command prompt emulation? By default it just starts the command prompt but you can let it start anything you want, so even a program to control winamp. If I understand correctly you want to start a application without cmd.exe, wright. If so here are two solutions. A quick hack is to use a batch file to set comspec and then load console, or you can edit the source. The file to edit is console.cpp and the part to edit is "StartShellProcess - allocates the console and starts the command shell". Just change it so that it does not use the comspec, but whatever  you want it to.

       
    • Marko Bozikovic

      Marko Bozikovic - 2003-06-02

      Try using the 'shell' attribute in 'console' tag, or -c cmd-line option (check out the Readme "Configuration & Usage")

       
    • Rob Davenport

      Rob Davenport - 2003-06-03

      walks,

      If you want to define your own commands, I'd just use doskey macros.  You can define them to run your own commands (CMD statements, batch files, or other programs).  Stick them in a file and launch console with the -c command-line option like bozho said.  Something like:
      -c /K c:\usr\local\bin\cmdstart.cmd

      Or you could use a different shell, like bash from the GNU project and use it's alias capability the same way - just change the shell attribute like bozho said, and define your aliases in your .profile or .login file.

      If you're asking for the ability to write your own plug-ins, a la Litestep, I don't believe that's supported. Pretty much anything you'd want to control can be done with macros, aliases, batch/cmd files or your own programs. 

      The only things you couldn't would be features of console itself - background image, for example.  That would be interesting to have access to from programs - like write your own macros/whatever to change the background image on command.  Since console doesn't process the commands it's displaying, I think you'd need console to listen for commands (via mailslot, COM object, or other IPC method) and then have another program that would send the commands from the command-line:
      ccmd -background "c:\gallery\space\galaxy.bmp"
      or the like.  that could be useful.

       

Log in to post a comment.