profile/systemd-osc-context: emit type= field first

Not because it is required by the specification, but it will make the following
patches simpler. Also, the fact that the spec explicitly does call out that
type= can appear at the end or in the middle suggests that people would
normally expect it to appear at the beginning.
This commit is contained in:
Rasmus Villemoes
2026-07-21 11:06:30 +02:00
parent ba95ad74e2
commit ac4c3e4290
+2 -2
View File
@@ -75,7 +75,7 @@ __systemd_osc_context_precmdline() {
fi
# Create or update the shell session
printf "\033]3008;start=%.64s%s;type=shell;cwd=%.255s\033\\" "$systemd_osc_context_shell_id" "$(__systemd_osc_context_common)" "$(__systemd_osc_context_escape "$PWD")"
printf "\033]3008;start=%.64s;type=shell%s;cwd=%.255s\033\\" "$systemd_osc_context_shell_id" "$(__systemd_osc_context_common)" "$(__systemd_osc_context_escape "$PWD")"
# Prepare cmd id for next command
read -r systemd_osc_context_cmd_id </proc/sys/kernel/random/uuid
@@ -85,7 +85,7 @@ __systemd_osc_context_ps0() {
# Skip if PROMPT_COMMAND= is cleared manually or by other profiles.
[ -n "${systemd_osc_context_cmd_id:-}" ] || return
printf "\033]3008;start=%.64s%s;type=command;cwd=%.255s\033\\" "$systemd_osc_context_cmd_id" "$(__systemd_osc_context_common)" "$(__systemd_osc_context_escape "$PWD")"
printf "\033]3008;start=%.64s;type=command%s;cwd=%.255s\033\\" "$systemd_osc_context_cmd_id" "$(__systemd_osc_context_common)" "$(__systemd_osc_context_escape "$PWD")"
}
if [ -n "${BASH_VERSION:-}" ]; then