oh-my-fish / theme-agnoster

MIT License
94 stars 63 forks source link

Reset color to normal after final segment separator #33

Closed tkindy closed 5 years ago

tkindy commented 5 years ago

Currently, the final foreground color in the prompt sticks around for the beginning of what the user types next. Usually, fish will try to suggest an autocomplete option (accompanied by a color change), so this isn't obvious. This will manifest if fish doesn't change the color right away, such as when the user types a valid one-letter command. I personally noticed this because I have an abbreviation g=git set; notice the green 'g' that matches the end of the prompt in the following image.

image

This PR fixes this issue by reseting the colors after echoing the last segment separator in prompt_finish. The bug and this PR's fix are demonstrated below by echoing a string after manually printing the prompt.

before after
image image
sn0cr commented 5 years ago

Looks good, but let's wait for #31 to merge before I merge this PR.

tkindy commented 5 years ago

@sn0cr sounds good, thanks!

sn0cr commented 5 years ago

@tkindy, sorry that it took so long.

tkindy commented 5 years ago

No problem @sn0cr, thanks!