📄 awfqawf.cpp
字号:
#include <curses.h>
int main(int argc,char *argv[])
{
int i;
initscr();
if(!has_color()||start_color()==ERR){
endwin();
printf("Terminal does not support color.\n");
exit(1);
}
init_pair(1,COLOR_GREEN,COLOR_BLANK);
init_pair(2,COLOR_RED,COLOR_BLANK);
init_pair(3,COLOR_CYAN,COLOR_BLANK);
init_pair(4,COLOR_WHITE,COLOR_BLANK);
init_pair(5,COLOR_MAGENTA,COLOR_BLANK);
init_pair(6,COLOR_BLUE,COLOR_BLANK);
init_pair(7,COLOR_YELLOW,COLOR_BLANK);
for(i=1;i<=7;i++){
attron(COLOR_PAIR(i));
printw("color pair %d in normal mode\n",i);
}
for(i=1;i<=7;i++)
attron(COLOR_PAIR(i)|A_UNDERLINE);
printw("color pair %d in normal mode\n",i);
}
refresh();
getch();
endwin();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -