]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
osc-context: fix typo: 8003 -> 3008
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Sep 2025 17:16:17 +0000 (02:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Sep 2025 20:42:04 +0000 (05:42 +0900)
Follow-up for dadbb34919abd3fefeb5b8ccc9794da9398a2503 (v258).

profile.d/80-systemd-osc-context.sh

index ee37c2507a4337eb84dd638febc75333b81ffbb2..13f04994ce2cd30beed348efbac5dc68a01471d9 100644 (file)
@@ -14,7 +14,7 @@
 [ -n "${BASH_VERSION:-}" ] || return 0
 
 __systemd_osc_context_escape() {
-    # Escape according to the OSC 8003 spec. Since this requires shelling out
+    # 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
     # processing strings we are pretty sure we won't need it for, such as
     # uuids, id128, hostnames, usernames, since they all come with syntax
@@ -33,11 +33,11 @@ __systemd_osc_context_precmdline() {
     # Close previous command
     if [ -n "${systemd_osc_context_cmd_id:-}" ]; then
         if [ "$systemd_exitstatus" -ge 127 ]; then
-            printf "\033]8003;end=%s;exit=interrupt;signal=%s\033\\" "$systemd_osc_context_cmd_id" $((systemd_exitstatus-127))
+            printf "\033]3008;end=%s;exit=interrupt;signal=%s\033\\" "$systemd_osc_context_cmd_id" $((systemd_exitstatus-127))
         elif [ "$systemd_exitstatus" -ne 0 ]; then
-            printf "\033]8003;end=%s;exit=failure;status=%s\033\\" "$systemd_osc_context_cmd_id" $((systemd_exitstatus))
+            printf "\033]3008;end=%s;exit=failure;status=%s\033\\" "$systemd_osc_context_cmd_id" $((systemd_exitstatus))
         else
-            printf "\033]8003;end=%s;exit=success\033\\" "$systemd_osc_context_cmd_id"
+            printf "\033]3008;end=%s;exit=success\033\\" "$systemd_osc_context_cmd_id"
         fi
     fi
 
@@ -47,7 +47,7 @@ __systemd_osc_context_precmdline() {
     fi
 
     # Create or update the shell session
-    printf "\033]8003;start=%s%s;type=shell;cwd=%s\033\\" "$systemd_osc_context_shell_id" "$(__systemd_osc_context_common)" "$(__systemd_osc_context_escape "$PWD")"
+    printf "\033]3008;start=%s%s;type=shell;cwd=%s\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
@@ -58,5 +58,5 @@ if [[ -n "${BASH_VERSION:-}" ]] && [[ "${TERM:-}" != "dumb" ]]; then
     PROMPT_COMMAND+=(__systemd_osc_context_precmdline)
 
     # PS0 is shown right after a prompt completed, but before the command is executed
-    PS0='\033]8003;start=$systemd_osc_context_cmd_id$(__systemd_osc_context_common);type=command;cwd=$(__systemd_osc_context_escape "$PWD")\033\\'"${PS0:-}"
+    PS0='\033]3008;start=$systemd_osc_context_cmd_id$(__systemd_osc_context_common);type=command;cwd=$(__systemd_osc_context_escape "$PWD")\033\\'"${PS0:-}"
 fi