From: Rasmus Villemoes Date: Mon, 20 Jul 2026 13:37:34 +0000 (+0200) Subject: profile/systemd-osc-context: don't do arithmetic expansion on systemd_exitstatus X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba95ad74e2a0ae7668990d8dc8356ff3706c8358;p=thirdparty%2Fsystemd.git profile/systemd-osc-context: don't do arithmetic expansion on systemd_exitstatus There's really no point in having bash do arithmetic expansion on the systemd_exitstatus variable, i.e. have it convert the string to a number, do no actual arithmetic, then convert it back to a string to be used as the argument to the printf, which will again convert it to a number for the %d specifier, and finally emit it as a decimal. Also, it deviates for no obvious reason from how it is passed to printf in the "probably died by signal" case just above. --- diff --git a/profile.d/80-systemd-osc-context.sh b/profile.d/80-systemd-osc-context.sh index 6e6812ce4db..4cfecfed269 100644 --- a/profile.d/80-systemd-osc-context.sh +++ b/profile.d/80-systemd-osc-context.sh @@ -63,7 +63,7 @@ __systemd_osc_context_precmdline() { if [ "$systemd_exitstatus" -gt 128 ] && systemd_signal=$(kill -l "$systemd_exitstatus" 2>&-); then printf "\033]3008;end=%.64s;exit=failure;status=%d;signal=SIG%s\033\\" "$systemd_osc_context_cmd_id" "$systemd_exitstatus" "$systemd_signal" elif [ "$systemd_exitstatus" -ne 0 ]; then - printf "\033]3008;end=%.64s;exit=failure;status=%d\033\\" "$systemd_osc_context_cmd_id" $((systemd_exitstatus)) + printf "\033]3008;end=%.64s;exit=failure;status=%d\033\\" "$systemd_osc_context_cmd_id" "$systemd_exitstatus" else printf "\033]3008;end=%.64s;exit=success\033\\" "$systemd_osc_context_cmd_id" fi