Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
Have you tried to follow the advice in the warning? – ak2 Feb 23 '12 at 11:21
    
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 Feb 23 '12 at 13:40
1  
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 Feb 23 '12 at 14:07
    
found it. It was in the environment variables. post as an answer so I can accept – ewok Feb 23 '12 at 14:11
up vote 17 down vote accepted

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.

share|improve this answer
    
Yes, this worked for me, and ak2'a answer didn't. How did you run into that? – barlop Mar 29 '12 at 21:57
    
Thanks, it worked for me, too! I would have never discovered it, I suppose... Thanks! – MarcoS Apr 20 '12 at 7:36
1  
My 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 Jun 5 '12 at 21:57
    
How did you remove the tty option from @CYGWIN? – ing0 Jun 21 '12 at 10:24

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

share|improve this answer
    
The CYGWIN variable for sshd is not set there. – reinierpost Feb 21 '13 at 12:10

+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
share|improve this answer
    
Great answer, being able to do all of it using the command line – Ludovic Kuty Apr 11 at 7:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .