3

ConEmu's docs give us an elegant way of injecting Clink. However, I'd like to specify Clink's --profile option (docs) so that I can keep my Clink settings alongside other config files in a common location.

Is this possible in ConEmu?

alexandrul
  • 1,082
Charles Roper
  • 10,879

2 Answers2

2

As the ConEmu author was reluctant to externalize the integration with external programs such as clink, you should resort to using an environment variable (unless you are happy with modifying clink installation).

The variable named clink_profile can be used to specify clink profile's location. It has preference over the --profile command-line switch.

You can define environment variables in ConEmu settings under the Startup/Environment section. You need to add something like below:

set clink_profile=%APPDATA%\clink\profile
ᄂ ᄀ
  • 4,187
1

ConEmu "loader" just tells cmd.exe to execute %ConEmuBaseDir%\clink\clink.bat inject.

So, the solution is simple. Rename original clink.bat to smth, for example clink_load.bat And create your own one-line clink.bat

@"%~dp0clink_load.bat" --profile yourpath inject

Even better, you may install (copy all files) clink to subfolder, e.g. %ConEmuBaseDir%\clink\vendor and create %ConEmuBaseDir%\clink\clink.bat containing

@"%~dp0vendor\clink.bat" %*

There you actually may pass any desired arguments to your clink loader. Even utilizing some environment variables from ConEmu settings.

Maximus
  • 20,835