回车(QUOT; \\ R")在C / Objective-C的广发行输出不工作 [英] Carriage return ("\r") in C/Objective-C in gdb output not working
问题描述
我要输出到命令行(到目前为止,在X $ C $℃以内gdb命令行)覆盖同一行。在code我现在使用打印输出的Objective-C的方法需要一些东西,并最终做到这一点:
I want output to the command line (so far, in the gdb command line within XCode) to overwrite the same line. The code I'm using to print the output right now takes some things from an Objective-C method and eventually does this:
unsigned char _output = ...;
printf("Output:%c\r",_output);
fflush(stdout);
它打印正确的输出,但在连续的线条,而不是覆盖。还有什么问题呢?
It prints the correct output, but on successive lines instead of overwriting. What could the problem be?
推荐答案
在X code中的GDB控制台不是一个功能齐全的终端仿真。这是为了支持具有GDB的互动,这就是它。如何控制字符的处理是要取决于你使用的终端模拟器。当您从直接使用Terminal.app命令行运行该工具会发生什么?怎么样的xterm?的rxvt?
The GDB console in Xcode is not a full-featured terminal emulation. It's intended to support interaction with GDB, and that's it. How control characters are handled is going to depend on the terminal emulator you use. What happens when you run the tool from the commandline directly using Terminal.app? What about xTerm? rxvt?
这篇关于回车(QUOT; \\ R")在C / Objective-C的广发行输出不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!