You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When correctly configured, in a new terminal window `$env:LEDGER_FILE` will show the file path,
6896
-
and so will `hledger files`.
6882
+
In a terminal window, follow the unix procedure above.
6883
+
6884
+
Also, this optional step may be helpful for GUI applications:
6885
+
6886
+
1. Add an entry to `~/.MacOSX/environment.plist` like
6887
+
6888
+
```json
6889
+
{
6890
+
"LEDGER_FILE" : "~/finance/my.journal"
6891
+
}
6892
+
```
6893
+
2. Run `killall Dock` in a terminal window (or restart the machine), to complete the change.
6894
+
6895
+
When correctly configured for GUI applications:
6896
+
6897
+
- apps started from the dock or a spotlight search, such as a GUI Emacs,
6898
+
will be aware of the new LEDGER_FILE setting.
6899
+
6900
+
### Set LEDGER_FILE on Windows
6901
+
6902
+
Using the gui is easiest:
6903
+
6904
+
1. In task bar, search for `environment variables`, and choose "Edit environment variables for your account".
6905
+
2. Create or change a `LEDGER_FILE` setting in the User variables pane.
6906
+
A typical value would be `C:\Users\USERNAME\finance\my.journal`.
6907
+
3. Click OK to complete the change.
6908
+
4. And open a new powershell window. (Existing windows won't see the change.)
6909
+
6910
+
Or at the command line, you can do it this way:
6911
+
6912
+
1. In a powershell window, run `[Environment]::SetEnvironmentVariable("LEDGER_FILE", "C:\User\USERNAME\finance\my.journal", [System.EnvironmentVariableTarget]::User)`
6913
+
2. And open a new powershell window. (Existing windows won't see the change.)
6914
+
6915
+
Warning, doing this from the Windows command line can be tricky; other methods you may find online:
6916
+
6917
+
- may not affect the current window
6918
+
- may not be persistent
6919
+
- may not work unless you are an administrator
6920
+
- may limit values to 1024 characters
6921
+
- may break dynamic references to other variables
6922
+
- may require a new-enough version of powershell
6923
+
- or may be intended for the older command window.
6924
+
- If you still have trouble, see eg
6925
+
[Setting Windows PowerShell environment variables](https://stackoverflow.com/questions/714877/setting-windows-powershell-environment-variables)
6926
+
or [Adding path permanently to windows using powershell doesn't appear to work](https://stackoverflow.com/questions/69236623/adding-path-permanently-to-windows-using-powershell-doesnt-appear-to-work).
6927
+
6928
+
When correctly configured:
6929
+
6930
+
- in a new powershell window, `$env:LEDGER_FILE` will show your new setting
6931
+
- and so should `hledger setup` and (once the file exists) `hledger files`.
0 commit comments