How to install WinGHCi working directory

I just installed WinGHCi. When I try to download the .hs file using Ctrl + L, it opens the file browser in C:\Program Files (x86)\Haskell Platform\2012.2.0.0\winghci , where I installed it. I don’t want it to go there by default, I keep my code files in a different directory on another drive, and I don’t want that every time I upload a file, I have to go to D:\MyPath\Haskell .

I tried to set the “Start at” field of the shortcut used to start WinGHCi, but did not change anything.

How can I make WinGHCi look in my own default directory?

+4
source share
1 answer

It opens in the last directory in which you opened .hs or .lhs.

Try to open something from the desired folder, exit, restart. Did it reboot where you were?

Try a little bit, and if you like it (I do), then everything is fine.


If you really want to go to the same place every time, there may be a way.

I cannot find any settings to control this, but the information is stored in a register. My is in

 Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Haskell\WinGHCi 1.0.6] "WorkingDir"="D:\\Files\\Andrew\\prog\\haskell" 

You can save your version of this as resetghci.reg : To create your own, open regedit and try the same place. If not, search for WinGHCi. You can export this subtree, but you will get the whole batch, including the latest expressions, etc., which I don’t think you should reset. Save this as ghcioriginal.reg just in case. Edit all lines except WorkingDir and save as resetghci.reg

When you double-click on it, it will ask you if you want to add this information to the registry. Yes you.


Unverified:

Which follows the older versions, but Microsoft seems to be leaving the .pif files and the start command, and I cannot verify this in Windows 7.

Make a text file named ghci.bat in the same folder as the .reg file you made. It sets

 @echo off regedit resetghci.reg start WinGHCi 

You may need to specify the full path to WinGHCi. The start command is the equivalent of Windows, which makes the background process from the command line, so it should stop immediately.

Make a shortcut for ghci.bat (it will be called ghci.pif) and set it so that it is minimized and puts a nice lambda icon on it (nickname from the winghci executable).

The pop that is displayed on the desktop, in the Start menu or in the quick access panel, and when you use it, you will return to your standard location.

+4
source

Source: https://habr.com/ru/post/1443792/


All Articles