Skip to content

profile.d: Make PROMPT_COMMAND a complete command - #716

Closed
xPMo wants to merge 1 commit into
containers:mainfrom
xPMo:patch-2
Closed

xPMo wants to merge 1 commit into
containers:mainfrom
xPMo:patch-2

Conversation

@xPMo

@xPMo xPMo commented Feb 27, 2021

Copy link
Copy Markdown
Contributor

See discussion on #710. Other users may also append a prompt command in a similar way.
Making this a : instead ensures that an appended command will not cause an error.

See discussion on containers#710. Other users may also append a prompt command in a similar way.
Making this a `:` instead ensures that an appended command will not cause an error.
@softwarefactory-delete-me

Copy link
Copy Markdown

Build succeeded.

Base automatically changed from master to main March 25, 2021 22:25
@martymichal

Copy link
Copy Markdown
Member

Hi @xPMo! Thank you for the patch.

What do you think, @debarshiray? I don't really understand this shell magic.

@martymichal martymichal added 2. Container Configuration Configuration of a container. Mounts, environmental variables, privileges. 2. Container Realm The issue is related to what happens inside of a toolbox container 3. Bugfix Fixes a bug labels May 24, 2021
@xPMo

xPMo commented May 24, 2021

Copy link
Copy Markdown
Contributor Author

It's been a while since I looked at this, and I remember that it's set to a non-empty string to prevent a half-broken workaround in Fedora's bashrc from triggering. (iirc this workaround is now more reliable as of F34). The issue was with it causing problems in Arch's bashrc, which tries to append to a non-empty PROMPT_COMMAND by first adding a semicolon to terminate the existing shell command, which does not work if there is no command. Setting PROMPT_COMMAND=':' or PROMPT_COMMAND='true' would cover both cases.

fwiw, Bash 5.1+ now allows PROMPT_COMMAND to be an array parameter explicitly to avoid this kind of mess.

@xPMo

xPMo commented May 24, 2021 •

Copy link
Copy Markdown
Contributor Author

@debarshiray

Copy link
Copy Markdown
Member

It's been a while since I looked at this, and I remember that
it's set to a non-empty string to prevent a half-broken workaround
in Fedora's bashrc from triggering. (iirc this workaround is
now more reliable as of F34).

The workaround was primarily for supporting UBI Toolboxes. It was not aimed at Fedora itself, even though one of the root causes for the problem seen on UBI Toolboxes was due to Fedora's /etc/bashrc (and hence all its downstream derivatives) doing something that it shouldn't.

The workaround only triggers if /etc/profile.d/vte.sh is absent. Is that really absent in Arch's Toolbox image? That file should be present so that VTE-based terminals can continue to track the current working directory.

The workaround is pretty gross, so the only thing that we should be doing is to remove it, once we have an UBI that contains /etc/profile.d/vte.sh.

@xPMo

xPMo commented Jul 2, 2021

Copy link
Copy Markdown
Contributor Author

The workaround only triggers if /etc/profile.d/vte.sh is absent. Is that really absent in Arch's Toolbox image? That file should be present so that VTE-based terminals can continue to track the current working directory.

Ah.

❯ pacman -F /etc/profile.d/vte.sh
etc/profile.d/vte.sh is owned by extra/vte-common 0.64.2-2

I don't use a VTE-based terminal, so I don't have it on my host. It is absent in #710, so I will see about adding it there.

The workaround is pretty gross, so the only thing that we should be doing is to remove it, once we have an UBI that contains /etc/profile.d/vte.sh.

I'm in agreement here, now. Closing in favor of waiting until that happens. Thanks for helping me track this down.

@xPMo xPMo closed this Jul 2, 2021
xPMo added a commit to xPMo/toolbox that referenced this pull request Jul 2, 2021
@xPMo xPMo mentioned this pull request Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. Container Configuration Configuration of a container. Mounts, environmental variables, privileges. 2. Container Realm The issue is related to what happens inside of a toolbox container 3. Bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants