Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fish_prompt for special working directories #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arkbriar
Copy link

@arkbriar arkbriar commented May 7, 2024

Before the change, working under directories like /t/mm will print a prompt like /t/m m >>> where you can find an unexpected blank in the middle. I didn't look into the exact cause but I presume it was probably caused by the escaped ANSI color commands (where m is a common character). The PR also fixes a problem for the substitution of ~ for those directories like /t/a~.

The fix applies to the sed command to

  • Restrict the substitution to the ~ at the beginning, which is supposed to be the home.
  • Restrict the substitution to the $base before the end, which is the only right location.
  • Add the trailing blank for home. Before the change it's ^^>>>, now it should be ^^ >>> correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant