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

Path color "bleeding" over to wrapped prompt, cursor wrongly positioned in when in git branch #4

Open
mbokman opened this issue Jul 5, 2017 · 6 comments

Comments

@mbokman
Copy link

mbokman commented Jul 5, 2017

Hiya,

First of all kudos on the nice work with agnoster-bash!

I am using this theme since recently and I think I have everything set up correctly but I am frequently encountering two issues:

  • When the path representing the current working directory gets really long and wraps, the blue color bleeds into the second line. It seems [34;43m is not interpreted correctly, as shown in the attached screenshot?
  • When I am in a directory representing a git environment and the prompt displays the branch, the cursor is incorrectly placed (approximately 6 characters to the left), as vaguely shown in the attached screen shot.

I am pretty much a shell/bash noob and I have no idea where to look for a solution.

I am running the latest stable release of iTerm2, using the 13pt Meslo LG M DZ Regular for Powerline font. My terminal emulation is set to ansi. This is a screenshot of a macOS High Sierra beta but I have the same issue on the latest release of Sierra, also when using Terminal.app.

agnoster

@speedenator
Copy link
Owner

Yup, bug. Easiest workaround is to use bash v4 (default on mac is v3). To fix:
% brew install bash
(don't have homebrew? Google it to install)

You should then have trimmed prompts so just two folders and ..., which will make things much easier overall.

@mbokman
Copy link
Author

mbokman commented Sep 6, 2017

Heya, thanks for the response. I will try the bash update via brew.

@mbokman
Copy link
Author

mbokman commented Sep 6, 2017

I installed bash via brew and added it to my /etc/shells. I do not see the issue anymore with not correctly interpreting [34;43m and the cursor placement now also looks good.

However, sometimes the blue color still bleeds over, as shown in the screenshot below.

I also do not have the trimmed prompts, is there something I need to do to enable those explicitly?

agnoster-bash

@speedenator
Copy link
Owner

hmm. progress at least!

what do you see when you run bash --version? Colors look way off now.

For dirtrim, what does:

% echo $PROMPT_DIRTRIM

show? and if nothing, what happens when you do the following:

% export PROMPT_DIRTRIM=2

@mbokman
Copy link
Author

mbokman commented Sep 11, 2017

Apologies, the colors are way off because it is a screenshot of me using Terminal.app where it is a known issue that the colors are incorrect. I have executed the commands you requested, I will provide the answers by means of a screenshot using iTerm2.

It looks like I am using the right version of bash, PROMPT_DIRTRIM is set correctly but still no trimmed prompts.

iterm2

Thanks very much for your help!

@himanshuxd
Copy link

Had the same problem, fixed it by using a different font, this one : Droid Sans Mono Dotted for Powerline Regular.

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

No branches or pull requests

3 participants