[ANNOUNCEMENT] Updated: mintty 2.9.5
Andrey Repin
anrdaemon@yandex.ru
Fri Dec 7 21:50:00 GMT 2018
Greetings, Thomas Wolff!
> Am 06.12.2018 um 22:32 schrieb Andrey Repin:
>> Greetings, Achim Gratz!
>>
>>> a) Just warn about the missing PATH component without changing the PATH.
>>> b) Give the user an option to let the command run with a separate PATH.
>>> Indeed there might be other things that are missing in the environment,
>>> so instead of just fixing up PATH you might consider using a wrapper
>>> that the user can change.
>> This is an interesting point.
>> Probably letting the user specify custom $PATH for quick commands (and save
>> current %PATH% as $ORIGINAL_PATH) may be the best choice.
>> The default can be %Cygwin%\bin:%PATH% or %PATH%:%Cygwin%\bin, I'm not very
>> concerned as long as it's explicit and customizable.
> I didn't expect the setup of this specific feature to be so strongly
> advocated :)
> In any case, things shouldn't become too complex. What I can image is an
> option UserCommandsPATH
> with one optional placeholder %s which would be replaced with the
> environment PATH;
> default /bin:%s, corresponding to current behaviour.
Using native paths and environment variable syntax, you can always use
ExpandEnvironmentString to get the %PATH% you need.
Cygwin DLL will then convert it to own version, avoiding you mangling it
yourself.
And I would strongly discourage from using placeholders familiar for you, but
unexpected by the end user and taken from entirely different area of knowledge.
BTW, Cygwin itself does it differently. %Cygwin%\bin is converted to /usr/bin.
>> If anybody need a wrapper, they may write and use it by themselves.
>>
>> (I already have one, written in TCC, working quite well.)
> Out of curiosity, what's TCC and what does your wrapper do?
This is an augmented CMD-like scripting platform.
https://jpsoft.com/products/tcc-cmd-prompt.html
Its "runtime" variant, TCC-RT, contains only scripting core, no interactive
functionality, and is distributed for free.
I attached the pair of scripts that I use to wrap .sh/.awk/.pl/etc. with.
In manual mode, I can use it to launch any script provided /usr/bin/env can
deal with it, as it's basically a wrapper around /usr/bin/env, which ensures
that the first argument (the script name) has Cygwin notation.
The fix-path thing is necessary to tweak startup behavior. Normal operation
environment don't have /usr/local/bin in %PATH%, as that hides some
Cygwin-specific scripts which have native counterparts in a different place.
P.S.
The %[variable] notation I use is not strictly necessary.
%var or %var% works equally well, but may be disabled in options.
I'm just playing on the safe side.
--
With best regards,
Andrey Repin
Saturday, December 8, 2018 0:16:49
Sorry for my terrible english...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwrap.btm
Type: application/octet-stream
Size: 730 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20181207/0f8e7a18/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-path.btm
Type: application/octet-stream
Size: 284 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20181207/0f8e7a18/attachment-0001.obj>
-------------- next part --------------
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list