Linux控制台操作功能

时间:2013-09-01 18:40:41

标签: c++ c linux console-application

这些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 

2 个答案:

答案 0 :(得分:3)

您可以尝试使用NCurses

  

获取光标位置

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

用于调整控制台窗口的大小

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

答案 1 :(得分:1)