1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00

8 Commits

Author SHA1 Message Date
Yu Watanabe
3b6288f6be osc-context: fix typo: 8003 -> 3008
Follow-up for dadbb34919 (v258).
2025-09-26 05:42:04 +09:00
Yu Watanabe
f79f89c202 profile: do not prompt OSC sequences when running on a dumb terminal 2025-08-13 23:43:51 +09:00
Yu Watanabe
0dc0bf4caf profile: replace default bash prompt with more informative one
The default bash PS1 provides mostly no information.
Let's replace it.

Before:
```
[watanabe@thinkpad-x280:~] $ run0
🦸 bash-5.2# echo $PS1
🦸 \s-\v\$
```

After:
```
[watanabe@thinkpad-x280:~] $ run0
🦸 [root@thinkpad-x280 watanabe]# echo $PS1
🦸 [\u@\h \W]\$
```

Fixes #38494.
2025-08-06 14:24:19 +01:00
Yu Watanabe
c0cc01de8a meson: use install_symlink() where applicable
Now our baseline of meson is 0.62, hence install_symlink() can be used.

Note, install_symlink() implies install_emptydir() for specified
install_dir. Hence, this also drops several unnecessary
install_emptydir() calls.

Note, the function currently does not support 'relative' and 'force' flags,
so several 'ln -frsT' inline calls cannot be replaced.
2025-03-10 02:41:40 +09:00
Yu Watanabe
649c63d6ac profile: return earlier if it is loaded from non-bash shell
Follow-up for dadbb34919.
2025-02-28 21:24:06 +09:00
Lennart Poettering
dadbb34919 profile: generate shell + command OSC events 2025-02-27 15:13:15 +01:00
Tobias Klauser
12e33d332b profile.d: don't bail if $SHELL_* variables are unset
If - for whatever reason - a script uses set -u (nounset) and includes
/etc/profile.d/70-systemd-shell-extra.sh (e.g. transitively via
/etc/profile) the script would fail with:

    /etc/profile.d/70-systemd-shell-extra.sh: line 15: SHELL_PROMPT_PREFIX: unbound variable

For example:

    $ cat > foo.sh <<EOF
    #!/bin/sh
    set -u

    source /etc/profile
    EOF
    $ chmod 700 foo.sh
    $ ./foo.sh
    /etc/profile.d/70-systemd-shell-extra.sh: line 15: SHELL_PROMPT_PREFIX: unbound variable

Fix this by using shell parameter substitution[^1] (which is a POSIX
shell concept) to set the $SHELL_* variables to the empty string if
undefined.

[^1]: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap02.html
2024-12-11 18:33:41 +00:00
Lennart Poettering
229d4a9806 shell: define three system credentials we can propagate into shell prompts and welcome messages 2024-09-09 19:03:48 +02:00