Mail Archives: cygwin/1997/12/01/02:55:11
I have recently provided a patch to Cygnus to provide control of various
environment variable settings on a program by program basis.
Geoffrey has asked that I get feedback on my changes to see if they are
something that is useful to the list as a whole.
My changes cause a program to read the registry for options settings prior
to reading settings from the environment. So, for instance, you can do
something like this:
cygwin -o 'c:\bin\bash.exe' binmode notitle
That will set options in the registry which will cause bash to always
use 'binmode' as its default and to never modify the title bar.
The available options are:
[no]binmode - Set default open mode
[no]title - Display program names on the console
title bar
[no]glob - [Do not] interpret wild cards on commands
run from CMD.
[no]strip_title - [Do not] strip the path component of files
names displayed in the title bar
[no]tty - Attach a UNIX-style tty to the program
All of the above are available as normal CYGWIN_* environment variables:
CYGWIN_BINMODE, CYGWIN_NOBINMODE
CYGWIN_TITLE, CYGWIN_NOTITLE
etc.
These settings are similar to those found in Sergey's recent coolview
release except that it is possible to say CYGWIN_NOTITLE as well as
CYGWIN_TITLE.
Which leads into another source of discussion. I would prefer something
like this for setting these options:
set CYGWIN32=binmode notitle tty
rather than:
set CYGWIN_BINMODE=1
set CYGWIN_TTY=1
set CYGWIN_NOTITLE=1
My current patch allows both uses but it would probably better to stick
with one.
Here are the pros and cons as we see them so far:
1) Registry
Pros:
a) Don't need to mess with system environment variables.
b) Allows pinpoint control of what program gets what options, e.g.
setting `tty' on for bash means that bash always starts with
a true /dev/tty. Other programs run from the command line will
not also use tty handling as seen when using the CYGWIN_TTY
environment variable.
c) "Solves" the problem of programs, ported from UNIX, which need
to use `binmode' by default.
Cons:
a) May slow down process startup slightly (I haven't noticed this
in simple tests, though).
b) Contributes to creeping featuritis.
c) The BINMODE option is nice, but may delay true port of a
product in favor of a "SET CYGWIN_BINMODE" band-aid.
2) CYGWIN32
Pros:
a) Minimizes environment variable name space pollution.
b) Mirrors proposed registry options syntax.
c) More intuitive?
Cons:
a) May be harder to test for in shell scripts.
b) Less intuitive?
I'd appreciate any and all feedback on this. Please send comments to the list
in general.
Thanks.
--
http://www.bbc.com/ cgf AT bbc DOT com "Strange how unreal
VMS=>UNIX Solutions Boston Business Computing the real can be."
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -