#1116617 \w prompt escape sequence not working in /root directory on Debian Trixie

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Leslie Rhorer
Date:
2025-09-29 07:05:02 UTC
Severity:
normal
#1116617#5
Date:
2025-09-29 07:02:58 UTC
From:
To:
Version: 5.2.37 (1)-release (x86_64-pc-linux-gnu)

Severity: minor

Tags: trixie regression

Description:

The \w escape sequence in bash prompts does not display the current
directory when the user is in the /root directory on Debian Trixie. This
behavior appears to be a regression from previous Debian versions.

Steps to reproduce:
1. Set PS1 to use \w: export PS1='\h:\w\$ '
2. Navigate to /root directory: cd /root
3. Observe that the prompt shows only hostname:$ instead of hostname:/root$

Expected behavior:
The prompt should display the full current directory path, including
when in /root.

Actual behavior:
The \w escape sequence fails to display the current directory when in
/root, but works correctly in all other directories.

Workaround:
Using $PWD instead of \w works correctly: export PS1='\h:$PWD\$ '

Additional information:
- This issue appears to be specific to Debian Trixie
- The behavior was not present in previous Debian versions
- The issue affects both regular root login and sudo sessions
- Other prompt escape sequences (like \h for hostname) work correctly

Environment:
- Debian version: Trixie
- Shell: bash
- Terminal: Tested in both Konsole and PuTTY