Skip to content

80-systemd-osc-context.sh leads to unexpected output #39133

@Ray-1989

Description

@Ray-1989

systemd version the issue has been seen with

258-4

Used distribution

ArchLinux

Linux kernel version used

6.16.8-arch3-1

CPU architectures issue was seen on

x86_64

Component

systemd

Expected behaviour you didn't see

This is a VM Guest in PVE(Proxmox Virtual Environment) 8.4. The following is the correct output before upgrade systemd from 257.7-1.

[root@archlinux ~]# echo $PROMPT_COMMAND
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"
[root@archlinux ~]# echo $PS0

[root@archlinux ~]# pacman -Qn systemd
systemd 257.7-1
[root@archlinux ~]# 

Unexpected behaviour you saw

The following is the unexpected output after upgrade systemd to 258-4.

03;start=44681544-a0ea-4ea1-85c8-1d9190d5a789;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=shell;cwd=/root[root@archlinux ~]# pwd
03;start=a28f7daa-8fff-4727-be98-71d854464e95;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=command;cwd=/root/root
03;end=a28f7daa-8fff-4727-be98-71d854464e95;exit=success03;start=44681544-a0ea-4ea1-85c8-1d9190d5a789;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=shell;cwd=/root[root@archlinux ~]# echo $PROMPT_COMMAND
03;start=a51a0aca-4eb9-408e-8767-f3900b7b2b03;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=command;cwd=/root__systemd_osc_context_precmdline
03;end=a51a0aca-4eb9-408e-8767-f3900b7b2b03;exit=success03;start=44681544-a0ea-4ea1-85c8-1d9190d5a789;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=shell;cwd=/root[root@archlinux ~]# echo $PS0
03;start=86b3cceb-54b0-4dec-b96b-0ff11b365c4b;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=command;cwd=/root\033]8003;start=$systemd_osc_context_cmd_id$(__systemd_osc_context_common);type=command;cwd=$(__systemd_osc_context_escape "$PWD")\033\\
03;end=86b3cceb-54b0-4dec-b96b-0ff11b365c4b;exit=success03;start=44681544-a0ea-4ea1-85c8-1d9190d5a789;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=shell;cwd=/root[root@archlinux ~]# 

I need to unset PROMPT_COMMAND and PS0 to bring it back to normal.

03;end=86b3cceb-54b0-4dec-b96b-0ff11b365c4b;exit=success03;start=44681544-a0ea-4ea1-85c8-1d9190d5a789;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=shell;cwd=/root[root@archlinux ~]# unset PROMPT_COMMAND
03;start=35429af8-8d4d-43f2-90de-c32ea9389fc0;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=command;cwd=/root[root@archlinux ~]# unset PS0
03;start=35429af8-8d4d-43f2-90de-c32ea9389fc0;user=root;hostname=archlinux;machineid=a283760a983749dbb26173669285ae5c;bootid=6df8736c-7230-4081-8028-2c0ef71001c8;pid=768;type=command;cwd=/root[root@archlinux ~]# 
[root@archlinux ~]# 
[root@archlinux ~]# pwd
/root
[root@archlinux ~]# pacman -Qn systemd
systemd 258-4
[root@archlinux ~]#

Steps to reproduce the problem

Upgrade systemd from 257.7-1 to 258-4.

Additional program output to the terminal or log subsystem illustrating the issue

The PROMPT_COMMAND and PS0 is set by /etc/profile.d/80-systemd-osc-context.sh in /etc/profile.


[root@archlinux ~]# pacman -Qo /etc/profile.d/80-systemd-osc-context.sh
/etc/profile.d/80-systemd-osc-context.sh is owned by systemd 258-4
[root@archlinux ~]#

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingpid1

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions