⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@egmontkob
Copy link
Contributor

Proposed changes

  • Make the hint bar, shell prompt and command line skinnable
  • Use buttonbar hotkey color for unused areas of buttonbar (if the winow is narrower than 70 columns), so that we don't have any non-skinnable characters
  • Remove "base" color value
  • Remove "[skin].terminal_default_color" key
  • Internal renames, cleanups and other minor fixes

Checklist

👉 Our coding style can be found here: https://midnight-commander.org/coding-style/ 👈

  • I have referenced the issue(s) resolved by this PR (if any)
  • I have signed-off my contribution with git commit --amend -s
  • Lint and unit tests pass locally with my changes (make indent && make check)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@github-actions github-actions bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels Jan 28, 2026
@github-actions github-actions bot added this to the Future Releases milestone Jan 28, 2026
@egmontkob egmontkob requested review from mc-worker and zyv January 28, 2026 12:57
@egmontkob
Copy link
Contributor Author

Please review along with pending questions in the referred issues, including:

  • will the next release be called 4.9?
  • if not, are we okay with landing this entire PR, or only the first 2 commits out of the 5?
  • are we okay with the slight visual change at the bottom-right corner if the window is narrow?
  • shall the keyword be "prompt" or "shellprompt"?

@egmontkob egmontkob force-pushed the 4974-cmdline-color branch 2 times, most recently from 1da4a18 to a79a9de Compare January 28, 2026 13:12
/* Color styles for label widgets */
label_colors_t label_colors;
label_colors_t hintbar_colors;
label_colors_t prompt_colors;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hintbar and prompt are parts of file manager. hintbar_colors and prompt_colors should be defined and declared in filemanager.[ch].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've had pretty much the same discussion in PR #4916 :)

I continued the existing pattern to keep the code consistent.

I agree with you that it would be a cleaner design pattern to declare and initialize these colors at the caller, rather than the widget knowing about them. In order to keep our code consistent, I guess the existing code (e.g. alarm a.k.a. error, listbox, and help colors) should also be ported to this pattern.

Practically, it would mean the introduction of several tiny new methods, e.g. adding an init() to help as per the discussion of that PR. Also, when initializing mc or when applying a skin, we'd need to call many more such small methods.

I have doubts that it would be an overall win. But let me know if you still want me to do this, I will do then. Or maybe meet halfway: if you'd want to do that refactoring around alarm_colors / listbox_colors / help_colors in the exisiting code and then I'll rebase my changes and keep following your pattern?


prompt_colors[LABEL_COLOR_MAIN] = CORE_PROMPT_COLOR;
prompt_colors[LABEL_COLOR_DISABLED] = CORE_DISABLED_COLOR; // unused
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hintbar_colors and prompt_colors assignments should be moved to a separate function in the file manager area.

@egmontkob
Copy link
Contributor Author

Labels in error dialogs have the wrong color.

I need to figure out how to denote in a label whether to inherit the colors from the parent widget (the wrongly removed colors = widget_get_colors (w); bits) or to store the colors in itself.

In a way that mostly fits the current design.

The "disabled" color is now hardwired to always use [core].disabled. The feature is only used in regular dialogs, not in error boxes -- and not in the newly added fields either. So it can probably stay hardcoded.

Which means that only a single color needs to be configurable. I might eliminate label_colors_t (and via that make the previous review comment irrelevant), just store either -1 for inheriting the color, or >=0 for an explicit value.

@zyv
Copy link
Member

zyv commented Jan 29, 2026

Please review along with pending questions in the referred issues, including:

I'm not sure what's the best place to have this discussion such that the posts are not mixed up with posts related to specific issues/PRs. Probably we could open a GitHub discussion for that. I would answer here, and if it becomes too annoying, then I would suggest we split it out.

  • will the next release be called 4.9?

My understanding is that Andrew didn't veto it, so in as far as I'm concerned, I'd say yes.

  • if not, are we okay with landing this entire PR, or only the first 2 commits out of the 5?

Irrelevant considering the above.

  • are we okay with the slight visual change at the bottom-right corner if the window is narrow?

In as far as I'm concerned, yes, I'm okay with that.

  • shall the keyword be "prompt" or "shellprompt"?

I think maybe this should be discussed in the ticket. I understand and agree that ambiguity is not good. However, I would tend towards "shell-prompt" or something like this if we decide to change it, because I find "separatorless" words annoying and very hard to read.

And, for the record, I'm still struggling to get through my mail.

@egmontkob
Copy link
Contributor Author

However, I would tend towards "shell-prompt" or something like this if we decide to change it, because I find "separatorless" words annoying and very hard to read.

I will go for "shellprompt" in this PR, to be consistent (separatorless) with all the other color words.

I agree with your preference of using a separator, see #3159. I'll probably address that, along with a backwards compatible fallback option as per #4975, for all existing keywords. Then it'll turn into "shell-prompt". If I get to do this in the same dev cycle (which I'm truly hoping and aiming for) then there'll be no need for compat fallback for this one.

@zyv zyv added area: skin Theming support and skin files and removed needs triage Needs triage by maintainers labels Jan 31, 2026
@zyv
Copy link
Member

zyv commented Jan 31, 2026

However, I would tend towards "shell-prompt" or something like this if we decide to change it, because I find "separatorless" words annoying and very hard to read.

I will go for "shellprompt" in this PR, to be consistent (separatorless) with all the other color words.

👍

@egmontkob
Copy link
Contributor Author

Rebased. Renamed "prompt" to "shellprompt". Removed the last commit for now (there are more variables named similarly, I'll have to rename all or none).

Still haven't addressed Andrew's comments, I'm thinking about a bit of underlying refactoring around color handling, let's see how that turns out...

@egmontkob egmontkob marked this pull request as draft February 4, 2026 09:59
This was referenced Feb 5, 2026
…dget

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
Variables referring to a color pair may now contain either the lowlevel color
pair id, or an identifier of the color role, the latter to be looked up in a
map according to the skin.

By using the color role id for as long as we can, rather than the resolved
color pair id, initializing colors and later changing skins becomes much more
straightforward.

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
@egmontkob egmontkob force-pushed the 4974-cmdline-color branch 2 times, most recently from 95c6cc6 to 36d8cd6 Compare February 8, 2026 00:26
@egmontkob
Copy link
Contributor Author

Rebased and adjusted to go on top of the current state of PR #4995. This addresses @mc-worker's two review comments.

Let's review / finish #4995 first and then we can return to this one.

…mmand line skinnable

New keywords "hintbar", "shellprompt" and "commandline" under the "[core]"
section of skin files control the colors of these parts of the screen.

Update the skins to still use terminal's default colors here, as before.

Remove the hline widget's unused transparent parameter, so that our widgets
don't have this concept anymore.

Fix some typos in comments.

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
…areas of buttonbar

This only affects windows narrower than 70 columns.

With this change, there are no more characters on the skin that aren't
skinnable and are necessarily of the terminal's default colors.

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
…color and "terminal_default_color" role

Remove support for the "base" color value which was presumably never used.

Remove support for the "[skin]" section's "terminal_default_color" keyword
which did not work and whose intent was unclear.

Remove the no longer used and misleadingly named internal variable
CORE_DEFAULT_COLOR.

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
@egmontkob
Copy link
Contributor Author

Labels in error dialogs have the wrong color.

Fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: skin Theming support and skin files prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

Skinnable hint bar & cmdline Revise "base" color Revise "terminal_default_color"

3 participants