Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#22161 - [bash] /etc/bash.bashrc overwrites the PROMPT_COMMAND

Attached to Project: Arch Linux
Opened by Joël Schaerer (lardon) - Monday, 20 December 2010, 22:08 GMT
Last edited by Allan McRae (Allan) - Wednesday, 02 February 2011, 05:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No



The file /etc/bash.bashrc provided by the bash package (it's a file provided by arch, not an upstream file. It's called system.bashrc in the bash package sources) overwrites the PROMPT_COMMAND variable.

This is bad because the file is sourced in /etc/profile *after* the various scripts located in /etc/profile.d. Some, such as autojump, may use the PROMPT_COMMAND to do things, so overwriting it breaks these scripts.

I can see two solutions:

1- Source /etc/bash.bashrc before the stuff in /etc/profile.d

2- Don't overwrite the PROMPT_COMMAND. Use something such as:

export PROMPT_COMMAND="${PROMPT_COMMAND:-:} ; arch stuff"
This task depends upon

Closed by  Allan McRae (Allan)
Wednesday, 02 February 2011, 05:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  bash-4.1.009-4 in [testing]