Skip to content

Fix fish_prompt for special working directories#15

Open
arkbriar wants to merge 1 commit into
oh-my-fish:masterfrom
arkbriar:master
Open

Fix fish_prompt for special working directories#15
arkbriar wants to merge 1 commit into
oh-my-fish:masterfrom
arkbriar:master

Conversation

@arkbriar

@arkbriar arkbriar commented May 7, 2024

Copy link
Copy Markdown

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.

Signed-off-by: arkbriar <arkbriar@gmail.com>
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