From 7d1b6b7b96ae3606d121d55956cdc774683041e8 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 14 May 2026 13:05:02 +0200 Subject: [PATCH] profile: bail out early if promptvars is disabled We need promptvars, otherwise the prompt strings won't undergo parameter expansion and we'd print them literally: $ shopt -u promptvars $ echo foo $(__systemd_osc_context_ps0)foo Resolves: #40620 --- profile.d/80-systemd-osc-context.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profile.d/80-systemd-osc-context.sh b/profile.d/80-systemd-osc-context.sh index 7d4b9a77f1..35bbb924cb 100644 --- a/profile.d/80-systemd-osc-context.sh +++ b/profile.d/80-systemd-osc-context.sh @@ -21,6 +21,10 @@ # Treat missing $TERM same as "dumb". [ "${TERM:-dumb}" = "dumb" ] && return 0 +# We need promptvars, otherwise the prompt strings won't undergo parameter expansion +# and we'd print them literally +shopt -q promptvars || return 0 + __systemd_osc_context_escape() { # Escape according to the OSC 3008 spec. Since this requires shelling out # to 'sed' we'll only do it where it's strictly necessary, and skip it when