[BUG]: $Env:SomeVar in komorebi.json causes komorebic to fail to start #294

Closed
opened 2026-01-05 14:49:32 +01:00 by adam · 4 comments
Owner

Originally created by @seancraven on GitHub (Feb 8, 2024).

Hi, Firstly thank you very much for this awesome piece of software! I use it everyday!

I would be really keen to contribute to add some extra logging or a break out of the start-up loop with a hint to run komorebic check, if that sounds good!

Describe the bug
When using Powershell environment variables in the komorebi.json Komorebi keeps trying to restart without issuing an error log.
$PROFILE file

$Env:KOMOREBI_CONFIG_HOME='C:\Users\SeanCraven\.config\komorebi'

such

In my config I tried to use the $env var:

{
    "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/master/schema.json",
    "app_specific_configuration_path": "$Env:KOMOREBI_USER_HOME\\applications.yaml",

Causes:

Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven\.config\komorebi\komorebi.json"' -WindowStyle
hidden
Waiting for komorebi.exe to start...komorebi.exe did not start... Trying again
Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven\.config\komorebi\komorebi.json"' -WindowStyle
hidden
Waiting for komorebi.exe to start...komorebi.exe did not start... Trying again
Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven\.config\komorebi\komorebi.json"' -WindowStyle
hidden
Waiting for komorebi.exe to start...komorebi.exe did not start... Trying again
Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven

Note when I run ls $Env:KOMOREB_CONFIG_HOME I see my config files, komorebi.json, applications.yaml.

To Reproduce
Steps to reproduce the behaviour:

  1. Add an environment variable to komorebi.json config file.
  2. komorebic start --config path/to/komorebi.json
  3. See bug

Expected behavior
I think if there is an error parsing a line of the config this should be presented to the user in the komorebic log command/ or in the main komorebic process.

OS Name:                   Microsoft Windows 11 Business
OS Version:                10.0.22631 N/A Build 22631

komorebic check Output
Provide the output of komorebic check
This could
image

Additional context
I don't have any other scripts running on start-up or akh etc.

Originally created by @seancraven on GitHub (Feb 8, 2024). Hi, Firstly thank you very much for this awesome piece of software! I use it everyday! I would be really keen to contribute to add some extra logging or a break out of the start-up loop with a hint to run komorebic check, if that sounds good! **Describe the bug** When using Powershell environment variables in the komorebi.json Komorebi keeps trying to restart without issuing an error log. $PROFILE file ``` $Env:KOMOREBI_CONFIG_HOME='C:\Users\SeanCraven\.config\komorebi' ``` such In my config I tried to use the $env var: ```json { "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/master/schema.json", "app_specific_configuration_path": "$Env:KOMOREBI_USER_HOME\\applications.yaml", ``` Causes: ``` Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven\.config\komorebi\komorebi.json"' -WindowStyle hidden Waiting for komorebi.exe to start...komorebi.exe did not start... Trying again Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven\.config\komorebi\komorebi.json"' -WindowStyle hidden Waiting for komorebi.exe to start...komorebi.exe did not start... Trying again Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven\.config\komorebi\komorebi.json"' -WindowStyle hidden Waiting for komorebi.exe to start...komorebi.exe did not start... Trying again Start-Process 'komorebi.exe' -ArgumentList '--config="C:\Users\SeanCraven ``` Note when I run `ls $Env:KOMOREB_CONFIG_HOME` I see my config files, komorebi.json, applications.yaml. **To Reproduce** Steps to reproduce the behaviour: 1. Add an environment variable to komorebi.json config file. 2. komorebic start --config path/to/komorebi.json 4. See bug **Expected behavior** I think if there is an error parsing a line of the config this should be presented to the user in the komorebic log command/ or in the main komorebic process. ``` OS Name: Microsoft Windows 11 Business OS Version: 10.0.22631 N/A Build 22631 ``` **`komorebic check` Output** Provide the output of `komorebic check` This could ![image](https://github.com/LGUG2Z/komorebi/assets/145337067/e9138b8c-a9b0-49e9-bf36-8f4d18f30399) **Additional context** I don't have any other scripts running on start-up or akh etc.
adam added the bug label 2026-01-05 14:49:32 +01:00
adam closed this issue 2026-01-05 14:49:32 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Feb 8, 2024):

JSON does not expand environment variables and $Env:USERPROFILE is currently a one-off, hard-coded string replacement done inside of komorebi.

@LGUG2Z commented on GitHub (Feb 8, 2024): JSON does not expand environment variables and `$Env:USERPROFILE` is currently a one-off, hard-coded string replacement done inside of komorebi.
Author
Owner

@LGUG2Z commented on GitHub (Feb 10, 2024):

Ending up adding support for this specific env var after all @seancraven, it will be in the next release!

@LGUG2Z commented on GitHub (Feb 10, 2024): Ending up adding support for this specific env var after all @seancraven, it will be in the next release!
Author
Owner

@seancraven commented on GitHub (Feb 10, 2024):

Thanks very much!

@seancraven commented on GitHub (Feb 10, 2024): Thanks very much!
Author
Owner

@LGUG2Z commented on GitHub (Feb 14, 2024):

Implemented on this video https://www.youtube.com/watch?v=XBOuvuFL9RE

@LGUG2Z commented on GitHub (Feb 14, 2024): Implemented on this video https://www.youtube.com/watch?v=XBOuvuFL9RE
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#294