"tty" option detected in CYGWIN environment variable

12

4

I recently reinstalled cygwin on my windows 7 machine, and added the cygwin directory to my path so that it works seamlessly with the windows command line. Every time I execute a command, I get the following above the actual output:

"tty" option detected in CYGWIN environment variable.
CYGWIN=tty is no longer supported.  Please remove it from your
CYGWIN environment variable and use a terminal emulator like mintty,
xterm, or rxvt.

How can I get rid of this so that I can use cygwin in my command line without the annoying header?

ewok

Posted 2012-02-22T19:17:13.043

Reputation: 2 743

Have you tried to follow the advice in the warning? – ak2 – 2012-02-23T11:21:44.760

how do I "remove it from my CYGWIN environment variable"? I would rather not use an emulator, as I like the seamlessness of using the cygwin commands in the windows command line. – ewok – 2012-02-23T13:40:14.483

1You must have the CYGWIN environment variable set somewhere, e.g. in a script you're using to start your command prompt or in the global Windows environment. You can find the latter in the Control Panel, under System->Advanced->Environment Variables. (At least that's where they are in XP; they might have moved in 7.) – ak2 – 2012-02-23T14:07:51.183

found it. It was in the environment variables. post as an answer so I can accept – ewok – 2012-02-23T14:11:17.023

Answers

18

I had the same issue, but there was no setting for the CYGWIN environment variable in any script or in the computer properties (Control Panel).

I then discovered that the sshd service had a setting for the CYGWIN environment variable in the Windows registry under the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\sshd\Parameters\Environment

By removing the tty option in the @CYGWIN string, the deprecation warning no longer appears when executing commands.

VirtualStaticVoid

Posted 2012-02-22T19:17:13.043

Reputation: 296

Yes, this worked for me, and ak2'a answer didn't. How did you run into that? – barlop – 2012-03-29T21:57:13.993

Thanks, it worked for me, too! I would have never discovered it, I suppose... Thanks! – MarcoS – 2012-04-20T07:36:43.877

1My sshd section did not have this, but I did find mine in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. Searching the registry for tty gets a lot of false positives; searching for binmode is much more effective. – Royce Williams – 2012-06-05T21:57:23.183

How did you remove the tty option from @CYGWIN? – ingh.am – 2012-06-21T10:24:37.393

3

You must have the CYGWIN environment variable set somewhere, e.g. in a script you're using to start your command prompt or in the global Windows environment. You can find the latter in the Control Panel, under System->Advanced->Environment Variables. (At least that's where they are in XP; they might have moved in 7.)

ak2

Posted 2012-02-22T19:17:13.043

Reputation: 3 387

The CYGWIN variable for sshd is not set there. – reinierpost – 2013-02-21T12:10:10.943

1

+1 for VirtualStaticVoid

You can see the setting here:

$ cat /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/sshd/Parameters/Environment/CYGWIN
tty ntsec

But it is read only. Here is how to fix it with only ssh access:

Create sshd-env.reg

$ cat <<EOF >sshd-env.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd\Parameters\Environment]
"CYGWIN"="ntsec"
EOF

Import it into the registry:

$ regedit.exe -s sshd-env.reg

Verify it took:

$ cat /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/sshd/Parameters/Environment/CYGWIN
ntsec

Somehow restart sshd.

Seems cygrunsrv doesn't have a --restart option. Shame. Without crontab installed, which it isn't by default, it might be easiest to reboot the machine. It is windows, after all.

$ shutdown -r -t 0

Dan Garthwaite

Posted 2012-02-22T19:17:13.043

Reputation: 111

Great answer, being able to do all of it using the command line – Ludovic Kuty – 2016-04-11T07:43:17.323