【问题标题】:Linux Console manipulating functionsLinux 控制台操作函数
【发布时间】:2013-09-04 21:04:09
【问题描述】:

这些 WinAPI 函数是否有 linux 控制台(/终端)等效项:

GetConsoleScreenBufferInfo // for getting cursor position
SetConsoleCursorPosition // for setting cursor position
SetConsoleWindowInfo // for resizing console window or hiding cursor
ReadConsoleOutputCharacter // for reading the character at some position
ReadConsoleOutputAttribute // for reading color info of the character at some position
WriteConsoleOutputAttribute // for changing color info of the character at some position 

?

【问题讨论】:

  • 你需要一个终端库。标准选择是ncurses

标签: c++ c linux console-application


【解决方案1】:

您可以尝试使用NCurses

获取光标位置

~$ echo -e "\033[6n"

用于调整控制台窗口大小

wmctrl -r "Mozilla Firefox" -e <G>,<X>,<Y>,<W>,<H>

【讨论】:

  • 你的控制台窗口标题很有趣
【解决方案2】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-05-13
相关资源
最近更新 更多