Cookbook/cmdAlternative

From Kx Wiki
Jump to: navigation, search

Using Console instead of cmd.exe

1. Download Console2 from http://sourceforge.net/projects/console/. The package is self contained, so you can unzip it and run immediately.

2. Create a batch file (replace QHOME and path to q.exe accordingly):

@echo off
set QHOME=C:\q
C:\q\w32\q.exe
pause

and save it somewhere as q.bat

3. Run Console, and go to settings menu ( Edit -> Settings... )

1.settings menu.PNG

4. Click on "Tabs" option where you can create a new session type

5. Set title as q, for Shell put the complete path to the batchfile q.bat we created above. Startup dir should be set to the QHOME directory (usually c:\q under windows). Click OK to save your settings.

3.set title shell and startup dir.PNG

6. On the Console window, create your shining new q session by clicking File -> New Tab -> q

4.start new q tab.PNG
5.q session.PNG

7. Finally, to enable copy/paste with your mouse, go to the settings window again ( Edit -> Settings... ) and click on Hotkeys -> Mouse. Change your settings as you prefer.

6.change select behavior.PNG

advantages of using Console2 over cmd

With some customization we can make Console2 behave like Gnome Terminal and PuTTY. You can set scrolling buffer, window size, fonts, and transparency. Overall, I find it more productive than ugly old cmd.exe

If you have Cygwin/MinGW installed on your machine, you can use the same technique to run w32 release of q from within the Cygwin/MinGW environment. In this case we need a similar batch file:

@echo off
set CHERE_INVOKING=1
C:\MinGW\msys\1.0\bin\bash.exe --login -i

and then within the GNU environment

alias q='/home/MYHOME/q/w32/q.exe'

Console will launch bash and from there you can invoke q.

All the above works for me. YMMV. If you have suggestions for other alternatives to running q on a windows console, please add them here!

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox