shell: define three system credentials we can propagate into shell prompts and welcome msgs - #34297
Merged
Merged
Conversation
poettering
force-pushed
the
shell-prompt-extra
branch
3 times, most recently
from
September 6, 2024 16:14
d132053 to
355ab43
Compare
Member
|
Ah, hmm, if this is at PAM level it indeed should work, no matter what login unsets. Nevermind... |
Member
Author
|
Yeah, it definitely works great here. |
yuwata
reviewed
Sep 6, 2024
yuwata
requested changes
Sep 6, 2024
poettering
force-pushed
the
shell-prompt-extra
branch
from
September 9, 2024 12:50
355ab43 to
dfa47d1
Compare
YHNdnzj
reviewed
Sep 9, 2024
poettering
force-pushed
the
shell-prompt-extra
branch
from
September 9, 2024 13:03
dfa47d1 to
91c4857
Compare
yuwata
approved these changes
Sep 9, 2024
YHNdnzj
reviewed
Sep 9, 2024
YHNdnzj
reviewed
Sep 9, 2024
poettering
force-pushed
the
shell-prompt-extra
branch
from
September 9, 2024 17:03
91c4857 to
ac805e9
Compare
…ompts and welcome messages
Let's make sure "no" is an acceptable setting for these paths.
poettering
force-pushed
the
shell-prompt-extra
branch
from
September 9, 2024 17:03
ac805e9 to
a8ea7c1
Compare
Member
|
Maybe better to backport the second commit ?? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I accidentally got into contact with some stuff WSL-lookalikes do to get an identifier into a shell prompt that indicates where they are. I didn't really like it at all.
Let's do something about it: define a clean way how we can pass a shell prompt prefix or suffix into services, logins and systems: via credentials that are propagated into environment variables, which a profile.d/ drop-in then inserts into PS1 or writes to stdout.
This is useful for many things, for example, for an nspawn or vmspawn-based WSL-lookalike we could do add to the invocation:
--set-credential="shell.prompt.prefix:📦 ".Or mkosi's interactive mode could set shell.prompt.prefix credential to "💽 " or so. Could also use ANSI colors or so.
I think this is vastly more elegant then the other approaches I have seen and relatively generic and universal. It just defines three credentials and three env vars, that can be set and consumed in a sane way.