By frenzy.i... on August 15, 2011 01:55 (imported from Google Code)
"Clear Buffer" clears all output except last line, which supposed to be a command prompt. But prompt can consist of more then one line. It would be great to set number of lines that isn't clear by "Clear Buffer".
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I would definitely love to see this happen, if possible. I use a multiline prompt and CMD+K is immensely useful, but it also clears the second line and only leaves the first.
Sorry to necro such an old issue, but I figured it better than filing a new one since it has labels and has been opened.
Sorry to post on this issue again after such a length of time, but I was just curious whether any progress has been made. I also was wondering if I could somehow contribute to the project since you mentioned it could be done with shell integration. I don't know what all's involved, so I don't know if that's feasible, but I'd be willing to help out should it be needed or welcomed.
How exactly should it work? I have a multiline prompt and pressing CMD + K to clear the buffer doesn't redraw both lines, just the second one, which is the original behavior.
You install prezto and then clone zsh-prompt-garrett into the $HOME/.zprezto/modules/prompt/external and then symlink the prompt_garrett_setup file to the $HOME/.zprezto/modules/prompt/functions directory.
Once you've done that, you just have to edit your $HOME/.zpreztorc and change zstyle ':prezto:module:prompt' theme 'sorin' to zstyle ':prezto:module:prompt' theme 'garrett'.
I hope those instructions are thorough enough to get you the same prompt as I have. If you have any questions, ping me. If you'd like me to provide you with the relevant config files or whatnot, let me know, too.
I've tried to do this before and failed. Tell me what your environment variables are and maybe that'll be enough to reproduce the bug. Better yet, send a debug log (https://iterm2.com/debuglog).
Here's a debug log for the clear buffer command. All I did was toggle debug logging, press CMD + K to clear the screen, then toggle debug logging again. Let me know if you need anything else.
Can you make a debug log that includes the appearance of a fresh prompt prior to doing cmd-k, please? I need to see why it didn't record the height of the prompt correctly.
Yeah, sorry about that. I didn't even think of that. This debug log has a couple cd commands to keep and re-draw the prompt on screen. I press Command + K in the middle and then use a few more cd commands to redraw the entire prompt.
There's some crazy stuff going on here. The prompt is not drawn by PS1 as far as i can tell, but probably by precmd. I don't know how I could support that in shell integration. Probably the only hope of making this work is to modify either the theme or prezto itself.