handle env var globbing/splitting
Closed this issue · 8 comments
From hyprwm/Hyprland/issues/5172, we should handle env var globbing/splitting.
Description:
We will use the bind = WIN, N, togglespecialworkspace, hi
throughout this.
input:
workspace = special:hi, on-created-empty:foot -H echo $HOSTNAME $TERM
output:
arch linux
input:
workspace = special:hi, on-created-empty:foot -H echo $TERM$HOSTNAME
output:
linuxarch
input:
workspace = special:hi, on-created-empty:foot -H echo $TERMINAL
output:
linuxINAL
input:
workspace = special:hi, on-created-empty:foot -H echo $HOSTNAME$TERM
output:
Now, with definitions in config.
input:
$HI=hello
workspace = special:hi, on-created-empty:foot -H echo $HI
output:
hello
input:
$TERMINAL=foot
workspace = special:hi, on-created-empty:foot -H echo $TERMINAL
output:
foot
-
The problem are we facing in hyprwm/Hyprland/issues/5172 is when we set a var to something that is or contains another hyprlang var, we now interpret global var (with globbing/splitting) having priority over a hyprlang var.
-
#32 wants to pass this info into the
source
keyword without defining (error occurs)
# this is a comment: $HOSTNAME=laptop
source=~/.config/hypr/$HOSTNAME.conf
workspace = special:hi, on-created-empty:foot -H echo $TERMINAL
if $TERM is defined, but $TERMINAL isn't, the output of linuxINAL
is expected, documented and just how it always has been
When defined, yeah. The issue is it is no longer considered defined when doing recursive vars.
please give a minimal reproducible example.
from hyprwm/Hyprland/issues/5172:
$TERMINAL = alacritty
$comms = [workspace special:hyprake] $TERMINAL --class hyprake
workspace = special:hyprake, on-created-empty:$comms
bind = WIN, N, togglespecialworkspace, hyprake
result is no terminal
This should help you see what is happening (linuxINAL):
$TERMINAL = foot
$comms = $TERMINAL
workspace = special:hyprake, on-created-empty:foot -H echo $comms
bind = WIN, N, togglespecialworkspace, hyprake