public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "David O'Shea" <david@ems.uq.edu.au>
To: David Peterson <david.peterson@mail.idrive.com>
Cc: cygwin@cygwin.com
Subject: Re: cygwin OpenSSH ssh-agent on Win2000
Date: Fri, 22 Dec 2000 00:36:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.10.10012221811150.511-100000@asyoulikeit.ems.uq.edu.au> (raw)
In-Reply-To: <000801c06bc0$45dc1d00$6400000a@minime>

Dear David,
	I haven't tried to do what you're doing, but possibly what I've
done will be of use to you.  I wanted a script to start explorer.exe on a
Windows 95 machine.  Here's what I did:

1. edit system.ini, and change the shell= line under the [boot] section.
This will probably be "explorer.exe".  You could set this to whatever you
want to run instead of explorer.exe (which can then start explorer.exe
itself), but there's one catch: explorer.exe checks this line to see if
it's the login shell.  It does this by seeing if the basename of the first
word is "explorer.exe", and if it is, it will bring up the task bar,
desktop, etc., otherwise it'll just show your "Windows Explorer" window.
My solution to this problem is to make a copy of start.exe called
"explorer.exe".  Explorer doesn't check the parameters, so here's my line:

shell=d:\usr\local\lib\winlogin\explorer.exe d:\usr\local\bin\winlogin.pif

winlogin.pif runs a batch file.  It'd be nice if it was a bash script, but
if you run the real Explorer from a cygwin app, that tty stays associated
with Explorer, and if you have any console apps that are run via context
menus in Explorer (e.g. a "Command Prompt Here" option when you
right-click a folder), most of the output from 16-bit and all of the
output from 32-bit apps will go to the tty you launched Explorer from, not
the console that was opened for the app.  I tried all sorts of ways to
dissociate the tty from Explorer: both 16 and 32-bit console and GUI apps
that execute Explorer, but I still couldn't get around this problem.  For
some strange reason, console apps run any other way (i.e. by opening them
in a folder or selecting them from the Start Menu) weren't affected.
Shame I'm so used to being able to right-click and pick "MS-DOS" or
"bash"..

2. Now you have to make the batch file.  You can run bash scripts from
here if you like, but it has to be the batch file that executes Explorer.
If you want to set environment variables, you have to use "winset" (came
with the Windows 95 resource kit) or else (off the top of my head) all
console apps won't see the variables.  However, if you use winset,
Explorer won't see the variables, and neither will non-console apps, so
the easiest solution is to use winset and then start explorer in this way:

start /m %COMSPEC% /c c:\windows\explorer.exe

Doing that creates a new console window with new environment variables set
by winset (the console you use winset in won't see the effects of winset)
so that Explorer can see them.

I guess that's about it.  As I said, this was for Windows 95, so it might
be easier, or be done completely differently, on NT/2000.  I've never
looked for a system.ini on an NT machine, so I don't even know if they
have them.  Even if this does work, I guess you'd have to do a bit of work
to adapt ssh-agent to work with the batch file and use winset to set
environment variables.

Good luck!
DOS

> Does anyone know how to start the explorer.exe process from ssh-agent when
> you log into an NT/2000 system?
> 
> I'm trying to do the same as "ssh-agent /etc/X11/xinit/xclients" to make the
> ssh agent available to all programs through the environment variables.
> 
> >From within a cygwin bash shell I can do "exec ssh-agent bash" (followed by
> ssh-add) and have everything work from that shell, but of course the
> variables don't exist in any other shells.
> 
> It would seem like having ssh-agent launch explorer when you log in would
> work, but I don't know what to tweak where in the registry.


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2000-12-22  0:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-21 18:39 David Peterson
2000-12-21 22:52 ` Richard Y. Kim
2000-12-22  0:36 ` David O'Shea [this message]
2000-12-22  1:31   ` Egor Duda
2001-01-02 18:15 David Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.10.10012221811150.511-100000@asyoulikeit.ems.uq.edu.au \
    --to=david@ems.uq.edu.au \
    --cc=cygwin@cygwin.com \
    --cc=david.peterson@mail.idrive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).