Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: highlight pasted text

Bart wrote:
> } On Jul 19,  5:12pm, Daniel Shahaf wrote:
> } Yuri D'Elia wrote on Sun, Jul 19, 2015 at 14:13:39 +0200:
> } > But chopping off that newline if it's the last character... hmm, I still
> } > think that's a good idea.
> } 
> } I'd rather text be pasted verbatim (for a number of reasons, I can
> } elaborate if needed).  How about doing
> } 
> }     zle -M "Press <Enter> to execute"

I'd prefer something more subtle but as a more lateral thinking approach
this is going in the right direction.

> It'd make more sense to (for example) always show the PS2 prompt after
> a paste that contains a newline, because that can both describe the
> context and indicate that the shell is waiting for more input.

I like that.

One disadvantage is that it wouldn't be compatible with the new feature
of highlighting pasted text; at least not having the highlighting
removed on the next action.

What would you use for the parser status that you get with %^ or %_?
The pasted text might leave an open parser status or might not.

Another disadvantage is that PS2 in general is irritating for the
fact that it restarts zle and push-line-or-edit tricks are needed on
up-cursor to allow editing the prebuffer.

As an aside, I recommend an empty $PS2 and transient_rprompt for RPS2
so the PS2 prompt doesn't get in the way of attempts to copy multi-line
commands with the mouse.


Messages sorted by: Reverse Date, Date, Thread, Author