/etc/profile.d/vte.sh: need to quote ~

Bug #1398799 reported by Peter Cordes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vte3 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Noticed the bug on trusty, still present in
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/vte3/vivid/view/head:/src/vte.sh

__vte_prompt_command():
"${PWD/#$HOME/~}" needs to be
"${PWD/#$HOME/\~}"

because ${parameter/pattern/string} does tilde expansion on string.

  The bash man page looks like its trying to say that it doesn't happen, but it does.
      In each of the cases below, word is subject to tilde expansion, parameter expansion, command substitution, and arithmetic
       expansion.
Unlike the other things, e.g. ${parameter##word}, ${parameter/pattern/string} uses "string" instead of "word".

 Quoting with a \ should be fine, since quote-removal will get rid of it even if they change the code to match the docs, and stop doing tilde expansion on the replacement string.

 Also, this is really a separate bug, but /etc/profile.d/* doesn't get sourced by non-login shells. This makes /etc/profile.d/vte.sh not very useful. There really ought to be a similar directory for non-login shells. bash-completion falls victim to this as well.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

For Vivid this should be fixed in /etc/profile.d/vte-2.91.sh as shipped by libvte-2.91-common. Could you please confirm it?

Even though Ubuntu will have to ship vte-2.90 and 2.91 in parallel for a while, I think they could just drop the libvte-2.90-common package and let everyone refer to vte-2.91.sh (and call that vte.sh for simplicity). I can't foresee how any future change in that script could break anything for older vte. As far as I recall, Fedora does this too.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> Also, this is really a separate bug, but /etc/profile.d/* doesn't get sourced by non-login shells. This makes /etc/profile.d/vte.sh not very useful. There really ought to be a similar directory for non-login shells. bash-completion falls victim to this as well.

This should be solved for Vivid, it was addressed in bug 1132700. I haven't verified though, maybe you could double check if they did it correctly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.