If you are hackish enough, you may want adding just another Explorer context menu item similar to Run with F# Interactive
, but keeping the console window open after .fsx
script terminates. Here is the working outline of how to achieve this for Windows7/VS2012:
- being admin open
regedit
and find the key HKEY_CLASSES_ROOT\VisualStudio.fsx.11.0\shell
- add new subkey with some unique name, like
openRunCmd
, make (Default)
value for this key whatever you like to see in context menu, maybe Run with Fsi in shell
finally, add subkey HKEY_CLASSES_ROOT\VisualStudio.fsx.11.0\shell\openRunCmd\command
and set (Default)
value for this subkey to the following line:
c:\windows\system32\cmd.exe /Q /K %%USERPROFILE%%\fsx.bat "%1"
Now, close regedit
, go to your home directory and create there a batch file fsx.bat
with the following line:
"C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\Fsi.exe" --quiet --exec "%1"
After these mods you would be able to click on any .fsx
script with right mouse button, pick Run with Fsi in shell
and have the shell window staying after script termination until you close it. With few small adjustments the same approach would work for VS2010.
Just be careful to adjust details, if your system settings differ from ones above. Good luck!
Update: For those who want to try this at home or at work I've posted a detailed walk-through here.