mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 20:40:06 +01:00
With --color=auto, coloring is enabled based on the .enable/.disable termcolors files. Likewise, when we enable coloring, we parse the color palette from the .schem termcolors files. The termcolors files are searched by finding the best match depending on the terminal and application name. Note, that if we find a matching file like "nmcli@xterm.enable" we still allow loading the palette from a less specific file like "nmcli.schem" and vice versa. That was already done before. Previously, the search was done by calling several layers of functions, and having in/out arguments "color_option" and "p_palette_buffer". in/out paramters here seems confusing to me, as they are state that gets modified and carried along. Instead, rework the functions to clearly separate between input and output arguments. Also, in the auto-case, check_colors() now first determines whether coloring is enabled, before even starting loading the palette. This avoids loading the palette until we are sure that we need it. |
||
|---|---|---|
| .. | ||
| agent.c | ||
| agent.h | ||
| common.c | ||
| common.h | ||
| connections.c | ||
| connections.h | ||
| devices.c | ||
| devices.h | ||
| general.c | ||
| general.h | ||
| meson.build | ||
| nmcli-completion | ||
| nmcli.c | ||
| nmcli.h | ||
| polkit-agent.c | ||
| polkit-agent.h | ||
| settings.c | ||
| settings.h | ||
| utils.c | ||
| utils.h | ||