What happened?
Pi’s footer shortens the cwd by replacing the home directory with “~”, but it uses a check that is too simplistic.
Steps to reproduce
Assume USER=user, HOME=/home/user, and cwd is /home/user2.
When Pi is launched, it will display cwd as “~2” in its footer, which obviously incorrect.
The relevant logic appears to be in the footer component:
let pwd = this.session.sessionManager.getCwd();
const home = process.env.HOME || process.env.USERPROFILE;
if (home && pwd.startsWith(home)) {
pwd = `~${pwd.slice(home.length)}`;
}
Expected behavior
The footer should display “/home/user2”.
Version
0.75.4
What happened?
Pi’s footer shortens the cwd by replacing the home directory with “~”, but it uses a check that is too simplistic.
Steps to reproduce
Assume
USER=user,HOME=/home/user, and cwd is/home/user2.When Pi is launched, it will display cwd as “~2” in its footer, which obviously incorrect.
The relevant logic appears to be in the footer component:
Expected behavior
The footer should display “/home/user2”.
Version
0.75.4