Skip to content

contest: vm: drop prompt hooks - #140

Merged
kuba-moo merged 1 commit into
linux-netdev:mainfrom
matttbe:vm-unset-PROMPT_COMMAND
Nov 17, 2026
Merged

kuba-moo merged 1 commit into
linux-netdev:mainfrom
matttbe:vm-unset-PROMPT_COMMAND

Conversation

@matttbe

@matttbe matttbe commented Nov 17, 2026

Copy link
Copy Markdown
Member

Some distributions set PROMPT_COMMAND and PS0 to print extra content around the prompt and each command, e.g. systemd's profile script printing OSC 3008 escape sequences when TERM is not 'dumb'.

This content is mixed with the commands output read from the serial console, e.g. 'echo $?' parsed by bash_prev_retcode().

Unset both variables when setting PS1 after the boot, so that only the expected prompt is printed.

Note that the current systemd services are already setting TERM=dumb, but it seems better to make sure this feature is always off by setting that here.

Some distributions set PROMPT_COMMAND and PS0 to print extra content
around the prompt and each command, e.g. systemd's profile script
printing OSC 3008 escape sequences when TERM is not 'dumb'.

This content is mixed with the commands output read from the serial
console, e.g. 'echo $?' parsed by bash_prev_retcode().

Unset both variables when setting PS1 after the boot, so that only the
expected prompt is printed.

Note that the current systemd services are already setting TERM=dumb,
but it seems better to make sure this feature is always off by setting
that here.

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
@kuba-moo
kuba-moo merged commit 8b2df47 into linux-netdev:main Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants