-
Notifications
You must be signed in to change notification settings - Fork 41
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
tcsh rprompt doesn't clear colors at the end of the string #18
Comments
This is a mis-feature because the attribute is attached to the next character after the attribute specifier. The same happens for the regular prompt. Perhaps there should be special NUL attributed character that just sets the attribute and does not print the character, followed by a regular NUL terminator. |
So by mis-feature you mean that this is a terminal issue and there's nothing that can be done about it? Is there not a zero-width character that I can place after? |
There is a zero-width space in UTF-8, but it won't help, as the code doesn't understand it being zero-width, so the Getting the zero-width space into
I saved that to a file to source it:
By the way, vi(1) will not work correctly with that file, either, as it doesn't understand the zero-widthness of the zero-width space. So it e.g. But taking your example:
You could just move the space preceding the colour code to be after it:
This would effectively give you the same appearance on screen, wouldn't it? The tcsh(1) manual page does document the fact that a literal escape sequence cannot be the last sequence in a prompt. |
Thanks for the ideas. I tried the zero-width space and, at least on my terminal (xterm-256color) it still left my color stuck at red. And yes, there was a space after "rprompt" in my example, but that was for readability. I want the "rprompt" to be fully right-justified, so having that space after the color is admittedly a fix for my example, but doesn't actually solve the problem. On top of that I just realized that there seems to be an additional space added after rprompt regardless. I.e., if I have 80 columns, then the last character of even just a simple "set rprompt='hi'" will actually be at col 79, which doesn't make sense to me and is not consistent with the "left" prompt. So now I've got two spaces to deal with.. :( |
I am experimenting with colors in tcsh prompts, and I use a prompt and rprompt.
I'm able to add colors to the prompt (and then turn off the color formatting fine), but when I add colors to the rprompt, I am unable to turn off the formatting.
As an example, for red:
So I tried these simple prompt settings:
And it turns everything red, including what I type and all my command results.
On the other hand, if you add any characters after the clear formatting codes, then the colors work as expected:
(Note the extra space)
This happens on multiple terminal types - is this a tcsh bug?
The text was updated successfully, but these errors were encountered: