Ncurses有限的输出大小 [英] Ncurses limited output size
问题描述
我正在学习如何使用ncurses,我在一个奇怪的情况。
看来我的输出不能超过24行。
此外,每当我运行我的软件,并且执行完成他的工作,我的终端停止工作,以前,我有两种不同的情况:
I'm learning how to use ncurses and I'm in a weird situation. It seems my output can't go over 24 lines. Moreover, whenever I run my software, and the execution finishes his job, my terminal stops working as before, and I have 2 different situations:
- 如果我从第24行后面的行启动了我的运行,我可以使用终端,但如果我在窗口的最后一行继续滚动,没有什么更多发生:所有输入和输出继续发生在
- 如果我已经启动第24行以上的运行,终端只会变为24行高。
这两种情况都要求我重置终端,然后一切正常。
我在MAC OSX机器上。
Both situations require me to reset the terminal, then everything works again. I'm on MAC OSX machine.
推荐答案
屏幕尺寸有问题:
- 最容易看到的是如果您将
LINES
环境变量设置为24. < a href =http://invisible-island.net/ncurses/man/curs_util.3x.html =nofollow>use_env
联机帮助页 - 屏幕尺寸问题的原因是,问题的描述表明程序将滚动区域设置为24行。
- 如果
LINES
没有问题,那么要检查的地方是运行stty -a
看看操作系统假设屏幕大小是什么。在stty
的第一行报告为rows。 - 在某些情况下连接),则可能有远程主机无法获取屏幕大小的会话。作为解决方法,您可以运行
resize
程序(xterm实用程序)更新操作系统的屏幕大小概念。
- The easiest one to see is if you has
LINES
environment variable set to 24. Theuse_env
manpage gives some clues about that. - The reason why it sounds like a problem with screen-size is that the description of the problem suggests that the program is setting the scrolling region to 24 lines.
- If there is no problem with
LINES
, then a place to check is by runningstty -a
to see what the operating system supposes the screen-size to be. That is reported on the first line ofstty
's output as "rows". - In some cases (for instance in remote network connections), it is possible to have a session where the remote host cannot obtain the screen-size. As a workaround, you could run the
resize
program (an xterm utility) to update the operating system's notion of the screen-size.
顺便说一句,您的其他问题 NCurses未恢复终端行为似乎与此重复。您应该将您的问题整合到一个单一的问题中,为某人提供足够的信息来提供有关该问题的有用信息。
By the way, your other question NCurses not restoring terminal behavior appears to be a duplicate of this. You should consolidate your questions into a single one which provides enough information for someone to offer useful information about the problem.
这篇关于Ncurses有限的输出大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!