在 Eclipse CDT 控制台中传递传输结束 (Ctrl + D) 字符

2024-03-03

我有一个 C++ 应用程序,我需要向其发送传输结束信号。

I can do a Ctrl+D on the console, but when I try that within Eclipse, it doesn't work.

我正在使用带有 CDT 的 Eclipse Galileo。


It seems to be a not yet resolved bug: bug 159803 https://bugs.eclipse.org/bugs/show_bug.cgi?id=159803 (resolved in September 2015, for CDT 9.0)

Since Eclipse 3.1 it is possible to signal EOF (using CTRL + D/Z - bindable in key preferences) in console view, and I tested this successfully with Eclipse 3.2.1 using a simple Java app.
CDT on the other hand will not recognize EOF when in console view.
There is one exception though.

如果我运行 C/C++ 本地应用程序并取消选中"Connect process input & output to a terminal"在主配置选项卡中,控制台视图will认出EOF.

但是,此更改不会影响处于“调试”视角时的控制台视图。所以在调试时我仍然无法发送EOF向正在运行的应用程序发出信号。

虽说已经“解决”了,这条评论 https://bugs.eclipse.org/bugs/show_bug.cgi?id=159803#c29显示问题仍然存在。


4年后更新(2014年12月),费尔南多·冈萨雷斯·桑切斯 https://stackoverflow.com/users/1001395/fernando-gonzalez-sanchez提及在评论中 https://stackoverflow.com/questions/4711098/passing-end-of-transmission-ctrl-d-character-in-eclipse-cdt-console/4711230#comment43807000_4711230:

UI 中不再提供解决方法复选框。
OpenSUSE 12 和 Eclipse CDT Luna 4.4.1 中仍然出现问题。


2015 年 3 月更新:

穆罕默德·安纳吉布 https://stackoverflow.com/users/2008463/muhammad-annaqeeb提及在评论中 https://stackoverflow.com/questions/4711098/passing-end-of-transmission-ctrl-d-character-in-eclipse-cdt-console/4711230?noredirect=1#comment46144363_4711230:

有一个错误页面中提到的新解决方法 https://bugs.eclipse.org/bugs/show_bug.cgi?id=159803#c10:

在 Linux 上的 Kepler 4.3 eclipse.buildId=4.3.0.M20130911-1000 中,Java 控制台中仍然存在问题。我找到了以下解决方法:

"If you leave the console to focus on another view, and then refocus on the console, then Ctrl-D (EOF) works as expected."

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 Eclipse CDT 控制台中传递传输结束 (Ctrl + D) 字符 的相关文章

随机推荐