Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: highlight pasted text
On Jul 21, 5:23pm, Oliver Kiddle wrote:
} Subject: Re: PATCH: highlight pasted text
}
} Bart wrote:
} > 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.
}
} 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.
}
} 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.
I didn't say "restart zle at the PS2 prompt" ... I just said to display
it. It could be handled like RPS2 and immediately removed as soon as
more keystrokes are received, at the time that the highlighting goes.
} 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.
Hm. Well, until there actually is an accept-line, the parser status
hasn't changed from when the paste began. Perhaps just append a "+"
or a "?" to the current value of %_ to indicate that the parser has
yet to determine its state?
} 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.
Yeah, this is a good idea. I think I'll add
RPS2="<${PS2%> }"
PS2=''
setopt transient_rprompt
or something akin to it, to prompt_bart_setup in the distribution.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author