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

Re: some way to inherit kill ring in su'd shell?



>>>>> Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> writes:

> Grotesque and there's probably a more elegant way which I'm missing, but
> you could rebind ^M from accept-line to a custom widget which does some

I guess I could just stuff the killring (I'd even be happy with just
CUTBUFFER) into an exported environment variable unconditionally for
every command.  Both ways I normally su preserve the environment.

Is the only way to do that to replace accept-line and friends with
custom widgets?  Could I instead use zle from a preexec hook somehow?

When not preserving the environment, you'd have the problem that each
user's shell startup needs to be hacked appropriately to look for and
slurp in the killring/CUTBUFFER; probably not worth it.

> check if the file is less than a minute old and, if so, source it.

Can you be more specific about how to slurp the killring/CUTBUFFER
back into the su'd to shell?

thanks,
Greg



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