mridgers / clink

Bash's powerful command line editing in cmd.exe
mridgers.github.io/clink
GNU General Public License v3.0
3.15k stars 286 forks source link

Clink does setup the autorun option correctly when an "if exists"-statement is in autorun Registry Key #576

Closed internationalTD closed 1 year ago

internationalTD commented 1 year ago

I installed miniconda and downloaded clink afterwards.

because of that, clink had the autorun registry value as native : if exist "C:\Users\-SNIP-\AppData\Local\Temp\_MEI62242\condabin\conda_hook.bat" "C:\Users\-SNIP-\AppData\Local\Temp\_MEI62242\condabin\conda_hook.bat" & "C:\Program Files (x86)\clink\clink.bat" inject --autorun

the if exists stopped clink from injecting. I needed to swap the two statements around the & to get it working.

(sidenote, the set command didn't work for me, something about unknown option -u, so i set it using regedit.exe, at HKEY_CURRENT_USER\Software\Microsoft\Command Processor

garoto commented 1 year ago

if exist <file> <command>. Perhaps drop the ampersand.


> touch file.ext

[ R:\ ]
> if exist file.ext (echo exist) else (echo dont)
exist
garoto commented 1 year ago

Just noticed this is mridgers repo issue tracker. You might while here to install the up-to-date and maintained fork located here: https://github.com/chrisant996/clink/

internationalTD commented 1 year ago

I am actually using that version, I should have double checked where I was. Sorry for wasting your time!

chrisant996 commented 1 year ago

If some programs add if commands in the AutoRun string, then they're going to cause problems with other things that also want to use AutoRun.

Clink can't realistically prevent those kinds of problems.

garoto commented 1 year ago

Just noticed that OP has indeed a valid IF EXIST statement, my bad.