-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Prompt overwrites last displayed line when catting file without trailing newline #46
Comments
Have you tried setting
in your |
Ah, I missed that one. It's not exactly what I had in mind but it might work just fine; I'll try it for a while. Thank you! |
I'd personally prefer not to add a blank line every time, only when necessary (with some kind of "(no EOL)" marker). But I'm not sure it's possible to detect beginning-of-line — is it? Maybe it is: https://stackoverflow.com/questions/8343250/how-can-i-get-position-of-cursor-in-terminal |
That would be my preference as well. |
That works very nicely, especially since it highlights the fact that the output is unterminated. |
@woutgg You're absolutely right, and it's my fault that it's getting turned off. I'll get this fixed in the next couple of days, all right? Thanks for your patience, and thanks for giving that temporary fix a try. |
Release v3.11.4 contains a fix for the reported behavior. Just go ahead and update the |
Awesome, thanks both for finding the option and fixing it! For anyone running into this, I also found it nice to be able to customize the string (default is export PROMPT_EOL_MARK="%S[NO EOL]%s" Sadly it doesn't seem to be possible to put this on the line after the unterminated line (as far as I can tell). Oh well, good enough! |
Great, thank you @agkozak for your efforts on this and the awesome prompt in general! |
Just popping in with another fun EOL mark: PROMPT_EOL_MARK='%F{red} %f' |
When using
cat
to display a file without trailing newline, the last line can (sometimes) be seen very briefly and is then overwritten by the (left-)prompt.Perhaps a non-empty line could be detected in which case the prompt either does not clear the line, or emits a newline first.
The text was updated successfully, but these errors were encountered: