Cmder: Update to use newest Clink in pre-release branch

Created on 22 Apr 2019  ·  23Comments  ·  Source: cmderdev/cmder

Purpose of the issue

  • [x] Bug report (encountered problems/errors)
  • [x] Feature request (request for new functionality)
  • [ ] Question

Version Information


Clink v1.0.0.a1
ConEmu 190331
Cmder 1.3.11.875 --prerelease


Windows 7

Description of the issue

I would like to use the newest binaries available and Cmder is behind. Understand having a stable branch but like VSCode and other projects, I prefer a beta branch that uses the latest releases.

https://github.com/mridgers/clink/releases

Currently clink fails to be called by Cmder/ConEmu. The error that appears is: inject: invalid option -- '-s'.

wontfix 👆 clink

Most helpful comment

The Clink 1.x.x alphas are not compatible with Cmder. I have opened issues with Clink to hopefully resolve this, see above.

All 23 comments

Cmder is a portable app. You can download the source and build the majority of it locally without any special tools. This would allow you to specify any versions you want.

If you want to put it in C:\program files, not recommended, you will need to give write access to the %cmder_root%\config folder to the user account using it which defeats the point of it being portable.

@wsluser Simply:

  1. Download/Clone the source distro.
  2. Copy the scripts folder from the source distro into your expanded binary distro.
  3. Install 7zip.
  4. Edit %cmder_root%\vendor\sources to include the versions you want.
  5. From a windows Powershell session, outside Cmder, change to %cmder_root%\scripts
  6. Run .\build.ps1 -verbose

This will delete all in %cmder_root%\vendor replacing it with what you specified in %cmder_root%\vendor\sources.

Ok thanks. I was hoping for an automated solution that built out the latest binaries vice building myself. Also I did have it installed in Program Data so that probably caused the permission error.

@wsluser Building yourself takes all of 5 min. Its what I do before doing a new release to test all is good. Note: This is not going to build a new cmder.exe binary It just assembles the updated component sources into the vendor folder.

Hey @daxgames just a heads-up, there are still to this day issues trying to run any newer build of clink due to #206 https://github.com/mridgers/clink/commit/3e012f3e9f671e697f87456b5b5101b5865003d8 where he just decided to remove a switch that cmder still uses in it's init files. So, if you drop-in any build of clink newer than 0.49, cmder will refuse to properly inject it and simply throw the "invalid argument -s" since that it how it currently still loads all the scripts into clink. Plus, clink is such that that is actually a terminating error, so the injection simply never even happens. It's a real PITA and would be nice to have cmder update to the latest clink since I have seen (amongst other issues) clink history continually be zeroed out and deleted with 0.49 at startup w/cmder. I believe it is the way older clink inits the history and running too many injections close together using the same history winds up just whacking it.

The newer clink seems to address that and numerous other issues I have seen so I would much rather not have to run it globally in path and simply update it within cmder.

Also @daxgames I see in latest commit you changed to (and I always enable this myself) to clink set history_io 1. Did you realize (I did NOT) that after 0.49 that option is also just up and gone?

with 1.0.x:

C:\>clink set history_io 1
ERROR: Setting 'history_io' not found.

Almost looks like a fork of clink may be required to keep it alive, anyway, and dropping/changing almost every option with zero docs seems a bit counterproductive to me. :(

@collinchaffin thanks for the heads up.

It kinda funny I was thinking of trying the clink alphas but have not been able to get to it.

Opened issue #519 with Clink fir missing -s|--script [path] argument.

Opened issue #520 with Clink for missing history_io setting.

The Clink 1.x.x alphas are not compatible with Cmder. I have opened issues with Clink to hopefully resolve this, see above.

I think the project is pretty much abandoned and would require someone such as yourself more familiar with the console internals to fork and make PR. There are other PRs pending that may prove useful adding as well if you decide to fork it.

I would not even bother with new Clink, it's just as dead as the .4.9 version

As it relates to this clink updating (and overall compatibility) issue I'm curious is anyone else having almost constant (yet randomized) issue with this happening to their clink .history file _upon close of CMDer_?

I just literally closed CMDer and finally watched it happen where the zeroing happens at close, despite having the clink history_io set to 1 for constant writing (which does actually work):

SNAG_6-14-2019_00-44-02

After a restore, this is what it looks like while running:

SNAG_6-14-2019_00-51-59

...and like I said even with multiple clink sessions open and all sharing the history_io as active flushing, that flushing/updating never zeros (AKA LOSES!) the history - at least until close I still put my $ on it being clink zeroing it and not CMDer.

I will continue testing to determine for sure whether it is as I suspect clink or only upon full CMDer/conemu close. Note this is actually with the normal 0.49 clink provided with CMDer - no updating which led me to wanting to update to begin with and hitting this issue.

@CollinChaffin I cant say I have seen it but it cant be Cmder since there is nothing actively running that is 'cmder'. Cmder launches conemu and exits then conemu starts cmd.exe that starts init.bat that starts clink. When init.bat is done it exits leaving clink running in cmd.exe in conemu.

It would have to be clink or MAYBE conemu. Are you closing conemu with multipe cmd tabs open or just one? If multiple what happens if you close one at a time?

@CollinChaffin I played a little with the Clink Alpha 1 today and I think there are equivalent settings to replace the history.io(history,shared) and the --scripts(clink.path).

I tried setting these in the new %cmder_root%\config\clink_settings file but that starts down a completely different path of incompatibilities. %cmder_root%\vendor\clink.lua tries to run but dies at line 11.

I have a feeling Clink will be stuck at 0.4.9 as far as Cmder is concerned.

Yup

Hey @daxgames so sorry I missed this reply! Thanks for the follow-up I'm going to try to do a bit of additional testing as well with some of the PRs I've seen floating around various forks for clink to try to even put a finger on what a decent proposal might be for it moving forward but it is good to see at least some of the key (go figure!) features (even more recently added ones like history, LOL) despite suddenly being forgotten in latest build at least have partial hacky workarounds. :)

EDIT: Sorry also @daxgames as far as the history suddenly being zeroed, I was about 99% sure off the bat it probably wasn't specifically CMDer as the root cause, but posted here since admittedly I think the CMDer community probably has far in the most day-to-day usage of CLink and since I keep seeing it happen on multiple machines can't be the only one it's happening to. My guess is it's just a bug in the shutdown/file close/final write of Clink in conjunction with enabling that relatively newly added history_io I'll try to dig a bit more into that code too.

Couldn't we just add the relevant lines back? If it wasn't breaking anything and it wasn't according to the issue it referenced, then cmder shouldn't need any changes. I would just fork the latest code, revert that PR that only removed it because he rather remove the feature than properly explain it in a document. At that point, I'd then review the other PRs and see if any of them are worth merging (which I think at least few of them are). I don't have time for this myself but if @CollinChaffin would spend time doing that instead of figuring out a hacky workaround, I think that would be optimal.

I updated the OP and title as the issue here is getting the latest Clink working.

It's not worth it, he commited in the middle of some rewrite state, just keep using the old one.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contribution(s).

Will not fix unless Clink becomes stable again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jenisys picture jenisys  ·  3Comments

tfarina picture tfarina  ·  3Comments

justinmchase picture justinmchase  ·  3Comments

giuliannosbrugnera picture giuliannosbrugnera  ·  3Comments

isnullxbh picture isnullxbh  ·  3Comments