main: Fix color schemes for abstract_ui

- Set 't_Co' to 256 at startup. The value can be changed by the user for
  compatibility with terminals that are less capable.
- `has('gui_running')` will return 1 if at least one rgb UI is attached.

Even though these changes are hacky, they are necessary to make the transition
to the new UI architecture smoother.
This commit is contained in:
Thiago de Arruda
2015-01-13 08:38:38 -03:00
parent 8f3e61a043
commit 3e9c55b51b
5 changed files with 24 additions and 13 deletions

View File

@@ -114,6 +114,16 @@ void ui_write(uint8_t *s, int len)
free(tofree);
}
bool ui_rgb_attached(void)
{
for (size_t i = 0; i < ui_count; i++) {
if (uis[i]->rgb) {
return true;
}
}
return false;
}
/*
* If the machine has job control, use it to suspend the program,
* otherwise fake it by starting a new shell.