I'm trying to set region captions to list all windows on active (focused) screen region, and only the title for other regions. For example:

caption always "%?%F %w %: %n*%t %?"

should display something like this:

1 Bash  2*Vim  3 Ipython      |  3*Ipython

However, the full list is displayed on both regions. Why does this happen and how can I fix it?


It happens because the %? *first part* %:%? will evaluate to true if one or more %escapes evaluates to a non-empty string. In your example %w expands to a list, making the first part true regardless of the %F modifier.

The closest I can get to circumventing this "flaw" is below, but it only gives the active and inactive regions different colors, not different content.

caption always '%?%F%{rk}%:%{wk}%n %?%F%:(%t) %?  %?'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.