Ncurses limited output size

心不动则不痛 提交于 2020-01-06 17:59:32

问题


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:

  • if I've launched my run from a line behind line 24 I can use the terminal, but if I keep scrolling when at the last line of the window, nothing more happens: all input and output keep happening in the last line, without any new line appearing at enter pressure.
  • if I've launched the run above line 24 the terminal will only become 24-lines high.

Both situations require me to reset the terminal, then everything works again. I'm on MAC OSX machine.


回答1:


There is a problem with the screen-size:

  • The easiest one to see is if you has LINES environment variable set to 24. The use_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 running stty -a to see what the operating system supposes the screen-size to be. That is reported on the first line of stty'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.

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.



来源:https://stackoverflow.com/questions/29171442/ncurses-limited-output-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!