-
Notifications
You must be signed in to change notification settings - Fork 745
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
Common Corner Case where Prompt Background bleeds into Input Field #249
Comments
I'm also able to reproduce using Mac Terminal Version 2.7. |
Interestingly, I didn't have this issue when I initially tried to reproduce it. But normally I use the "flat" display mode so I don't have the unicode arrows in my prompt. I should test whether this is a contributing factor. |
doesn't seem to be the unicode characters. I was not experiencing this when I originally attempted to reproduce because using the After more testing it appears to be related to the use of colors. I stripped out the code that adds any colors and the issue disappears. Still need to dig further into this. |
I am inclined to think this is a bug with bash or some other underlying system. I have been testing with a very simple PS1 with colors:
Which results in the same error. That prompt just sets the background color, prints the current directory, then resets the background color. I am getting the same bleeding with it. |
Ok, I believe I found a solution: export PS1='\[\033[48;05;10m\] \w \[\033[0m\]\[\033[0K' Will need to test a bit more. |
Woah interesting. I am curious how you found that. I tried searching around for this problem but didn't come up with anything. |
Here we go ( see the Clear Line bullet point ): Hmm , I think the search was for "ansi color vt100 color codes lines wrap" that came up with that search result. |
This appears to fix it: diff --git a/powerline_shell/__init__.py b/powerline_shell/__init__.py
index 68eb227..603b425 100644
--- a/powerline_shell/__init__.py
+++ b/powerline_shell/__init__.py
@@ -90,7 +90,7 @@ class Powerline(object):
self.cwd = get_valid_cwd()
mode = config.get("mode", "patched")
self.color_template = self.color_templates[args.shell]
- self.reset = self.color_template % '[0m'
+ self.reset = self.color_template % '[0m\]\[\e[0K'
self.lock = Powerline.symbols[mode]['lock']
self.network = Powerline.symbols[mode]['network']
self.separator = Powerline.symbols[mode]['separator'] |
Looks about right based on what you've provide so far. This will need some extensive testing, including against other shells. |
I have the same issue, after applying the suggested patch, things seem to be working correctly. I am running bash 4.4.12 on Ubuntu 17.10. |
The proposed fix broke things on Mac (#389 ) |
As a local fix in one's Essentially it is doing the thing from This change works for me! |
Prompt that is longer than terminal size and wraps around, draws the background after prompt incorrectly after prompt reaches bottom of terminal.
Environment:
I have been able to reproduce on several mac laptops. How to reproduce:
Can someone try and reproduce, and let me know i'm not crazy.
The text was updated successfully, but these errors were encountered: