Add after this line:
wattroff(ctx->history, COLOR_PAIR(2));