This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Attn: base-files maintainer] Changing /etc/profile to add more shell-dependent settings


Adam Dinwoodie writes:
> The /etc/defaults/etc/profile file in base-files has a section at the
> end to import scripts in /etc/profile.d, but this currently only works
> with zsh.

No, this section is specific to zsh and probably even the wrong thing to
do -- /etc/profile is only ever intended to be run by POSIX compatible
shells (or shells in POSIX mode if they support that notion).  I've kept
it alive for the time being since nothing packaged in Cygwin depends on
it.  For anybody else using it for their personal customization it must
already be working.

> Can this section be expanded to make calls as appropriate for other
> shells?  I'm particularly interested in Fish and Bash, although I don't
> see any reason to limit the change to those shells.

Bash can use ".sh" with the proviso that you can only use the POSIX
subset of its functionality.  Other, non-POSIX, shells should implement
something similar in their own startup scripts.  Csh already does, I
don't know enough about fish to tell how to insert something into its
start-up.  IIRC, Zsh also has a way to run extra code besides just the
one in /etc/profile if you somehow need that.

> I care about this because I'm currently investigating packaging fzf[0].
> The obvious way to include the shell-specific keyboard shortcuts for fzf
> is to add them to /etc/profile.d, but currently that only works for
> Z-Shell.

Look again, and don't let yourself get distracted by the zsh specific
code.  :-)


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]