12

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?

4
  • Have you tried to follow the advice in the warning?
    – ak2
    Feb 23, 2012 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, 2012 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, 2012 at 14:07
  • found it. It was in the environment variables. post as an answer so I can accept
    – ewok
    Feb 23, 2012 at 14:11

3 Answers 3

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.

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

1
  • The CYGWIN variable for sshd is not set there. Feb 21, 2013 at 12:10
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
1
  • Great answer, being able to do all of it using the command line Apr 11, 2016 at 7:43

You must log in to answer this question.

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