Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hiya 👋
This PR introduces 2 new changes to the behaviour of the plugin, which can be optionally configured.
Code quality and semantics aside, I'd like to clarify the intended behaviour of the new functionality with some examples below. If you agree, I can update the documentation with some examples and switch the status of this PR to ready for review.
Examples
Case 1: Overriding Default Colours
Config:
Intended Behaviour:
The above config would result in all tabs cycling through 3 colours that the user has defined. The first 2 colours are indices to be retrieved from Wezterm's palette via ANSI colours. The 3rd is a hex colour and should be directly passed to the configuration.
Case 2: Overriding Colours Based On Tab Title
Config:
Intended Behaviour:
All tabs should follow the default colours defined. However, on tabs that contain the string
nvim
orssh
in their titles, the colours should be overridden as per the foreground and background values. In this example,nvim
tabs should have a background of the 4th ANSI colour andssh
tabs should have a white background with a dark foreground.Case 3: Modifying Title Based On Tab
Config:
Intended Behaviour:
All tabs should follow the default colours defined. On tabs that contain the string
ssh
in their titles, the title of the tab should always be pre-pended with the string"🐎 "
Case 4: Modifying Title Based On Some Abitrary Condition
Config:
Intended Behaviour:
All tabs should follow the default colours defined. The definition of the
matcher()
function allows the user to define their own custom condition on when the override should be applied. In this particular example, on all tabs that have the foreground processssh
running - the title of the tab should always be pre-pended with the string"🐎 "
There are, of course, more permutations that can be showcased but I think these cases cover the majority of them. Let me know what you think!