You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After slightly more testing, it appears that square brackets around a variable are used to omit that section if the relevant variable is unset. For instance, the window-command echo "test [host={host}] asdf" prints test asdf, since {host} is unset in the window mode.
This behavior makes sense, but doesn't seem to be documented anywhere that I could find. Personally, I think the PATTERN section of the the rofi(1) manpage would be most logical.
Resolving my original issue, then, requires a command such as echo "[[id={window}]]" — the inner brackets will be dropped (since the enclosed {window} variable is set), and the outer brackets will remain.
LRitzdorf
changed the title
[BUG] Square brackets removed from pattern when they contain a variable
[REQUEST] Document behavior of square brackets containing a variable
Jan 9, 2024
Rofi version (rofi -v)
1.7.5
Configuration
Blank (tested with
-config /dev/null
; issue persists)Theme
Arc Dark
Timing report
No response
Launch command
rofi -show window
Step to reproduce
window-command
which includes square brackets, such asecho "bracket test: [id={window}] [asdf]"
.Note that the same issue occurs with other command fields as well, such as
run-command
in the run mode.Expected behavior
A command such as
echo "[id={window}]"
should output (for example)[id=48235161]
, with brackets.Actual behavior
A command such as
echo "[id={window}]"
outputs (for example)id=48235161
, without brackets.Additional information
Having no experience with Rofi's internals, this feels like maybe a parser issue?
I've tried variations of my test command, for instance escaping the brackets with single and double backslashes, but none of these resolved the issue.
Using wayland display server protocol
I've checked if the issue exists in the latest stable release
The text was updated successfully, but these errors were encountered: