输入密钥有时无法识别在windows应用程序下cygwin [英] enter key sometimes not recognized in windows apps under cygwin

查看:264
本文介绍了输入密钥有时无法识别在windows应用程序下cygwin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我使用Cygwin很多,因为它在Windows的广阔的沙漠中为我提供了一个小绿洲。我不可避免地最终通过bash shell运行一些非Cygwin程序,例如构建脚本(内部创建的批处理文件)和Subversion CLI二进制文件(我安装了Windows)。 99%的时间,我没有使用此设置的任何问题。其他1%,但是,导致一个奇怪的问题:

At work, I use Cygwin a lot because it offers me a small oasis in the vast desert of Windows. I inevitably end up running some non-Cygwin programs through the bash shell, such as build scripts (batch files created in-house) and the Subversion CLI binaries (I have the Windows ones installed). 99% of the time, I don't have any problems using this setup. The other 1%, however, causes a strange issue:

对于构建脚本和SVN,大多数时间的输入键被正确解释。例如,我将启动数据库创建脚本,它会提示我输入服务器名称。我输入localhost并按回车。一切安好。然后它到最后,如果有错误,并使用更多打印出东西。我按下的键不会被更多识别。我必须Ctrl-C出来。

With both the build scripts and SVN, most of the time the enter key is interpreted correctly. For instance, I'll kick off the database creation script and it will prompt me for the server name. I type in "localhost" and hit enter. Everything's fine. Then it gets to the end, if there are errors, and prints things out using more. No key that I press is recognized by more. I have to Ctrl-C out of it.

同样,如果我做一个Subversion更新,通常一切都很好。然而,在交互冲突解决的情况下,我通常键入tf为他们的完整,并按Enter键,但什么也没有发生。我必须Ctrl-C出来,并重新运行更新与强制合并或使用TortoiseSVN在Windows中做。

Similarly, if I do a Subversion update, normally everything is fine. In the case where the interactive conflict resolution happens, however, I'll usually type in "tf" for "theirs-full" and hit enter, but nothing happens. I have to Ctrl-C out of it and re-run the update with force merge or use TortoiseSVN in Windows to do it.

任何想法为什么Cygwin似乎随机不通过回车键到程序?我认为它可能与Unix VS Windows样式行结束有关,所以我已经尝试手动键入这些字符,但是这似乎没有什么区别。非常感谢。

Any idea why Cygwin seems to randomly not be passing the enter key through to the programs? I considered that it may have something to do with Unix vs Windows style line endings, so I've tried typing those characters manually, but that doesn't seem to make a difference. Thanks.

编辑:我只是发生在我身上,我意识到了一些事情。这是SVN提示我输入密码。我输入的密码,它回声到屏幕(坏),并按Enter键...没有。点击进入几次,光标移动,但什么也没有发生。我按Ctrl-C,它将我转回到bash,然后说bash:[我的密码]:命令未找到后跟一些新的提示,等于我按下回车键的次数。所以发生了什么事是输入从来没有做到SVN,但不知何故得到读取的bash后SVN退出。

Edit: I just had this happen to me again and I realized something. It was SVN prompting me for a password. I typed in the password, which it echoed to the screen (bad) and hit enter... nothing. Hit enter a few more times, the cursor moves, but nothing happens. I hit Ctrl-C and it dumps me back to bash, which then says "bash: [my password]: command not found" followed by a number of new prompts equal to the number of times I hit the enter key. So what happened is the input never made it to SVN, but somehow got read by bash after SVN exited. I thought that may help someone figure out what is going on.

推荐答案

不幸的是,我认为你正在碰到一个问题Cygwin和windows / dos控制台应用程序。请参阅 http://www.cygwin.com/cygwin上的控制台程序 -ug-net / using-efficiently.html

Unfortunately, I think you are hitting one of the issues of Cygwin and windows/dos console apps. See "Console Programs" at http://www.cygwin.com/cygwin-ug-net/using-effectively.html.

这只是Windows控制台应用程序的一个限制。这种行为对于windows的myqsl cmd客户端和svn客户端是常见的。

It is just a limitation on windows console apps. This behavior is common for the windows myqsl cmd client and svn client, for example.

这里有一些事情需要注意 - 我已经成功地使用这种方法与Windows mysql以及Windows svn客户端:

Here are some things to note -- I've successfully used this approach with both the Windows mysql as well as Windows svn clients:

1)尝试确保您的CYGWIN环境变量中没有tty,看看是否有帮助我的电脑 - >属性 - >高级 - >环境变量和关闭/重新启动任何cygwin bash提示)。

1) Try making sure you do NOT have "tty" in your CYGWIN environment variable and see if that helps (unset it in My Computer->properties->advanced->Environment Variables and close/restart any cygwin bash prompts).

2)不要使用RXVT - Cygwin cmd提示符。这是因为RXVT意味着tty并且会破坏#1以上。

2) Do not use RXVT -- instead, use the basic Cygwin cmd prompt. This is because RXVT implies "tty" and will break #1 above.

3)尝试找到一个原生Cygwin软件包,使用Windows cmds。 (我还没有找到一个1.6 svn的客户端,但cygwin)。

3) Try finding a "native" Cygwin package for the cmds you are having issues with instead of using the Windows cmds. (I haven't found a 1.6 svn client for cygwin yet, though.)

祝你好运!
Dustin

Good luck! Dustin

这篇关于输入密钥有时无法识别在windows应用程序下cygwin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆