I am recently working on a game project using the curses
library, and I used color-related functions like start_color()
, init_color()
and init_pair()
. The color works well in my project, but once its used, the colors in other TUI
applications like vim
will go wrong.
For example: When I first edit some part of my code, it is like this:
This is vim
with colorscheme slate
, and it looks good.
However, when I run my code and exit and edit the code again, it become something like this:
Note: I did not change anything when I did this, and I thought that it is because I have changed the color definitions when I run my code. Also, if I use other functions, it will also go wrong, like:
But the original one should look like this:
I wanna know why this is happening, I thought there may be some ending functions of color I am not using, just like initscr()
and endwin()
, there should be another one for start_color()
. Can anyone tell me why? Thanks a lot.