Skip to content

Footer abbreviates /home/user2 as ~2 when HOME is /home/user #4878

@grothesque

Description

@grothesque

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginprogressIssue is being worked on

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions