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?

0

2 Answers 2

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
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.

5
  • Related issue: github.com/mridgers/clink/issues/390
    – Maximus
    Commented Apr 11, 2016 at 22:47
  • 1
    It's definitely not a good idea to edit ConEmu's files since they will be overwritten every time you upgrade ConEmu to a newer version. Commented Sep 11, 2018 at 19:18
  • ConEmu doesn't supply clink files via ConEmu distro. These files are put by user manually.
    – Maximus
    Commented Sep 12, 2018 at 0:10
  • 1
    OK, it's not part of ConEmu but clink. Anyway, my note is still valid - it's better to not change files which are distributed with some software. Definitely if there's some other way. Commented Sep 12, 2018 at 3:50
  • I insist that using batches is more flexible way. But the answer us updated.
    – Maximus
    Commented Sep 18, 2018 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .