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

Re: Injecting a command into stdin / input

On Thu, Sep 8, 2022 at 3:27 AM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
> Hello All!
> I've been doing some rather ridiculous things with zsh-defer [1] in order to speed up my shell startup time.  I've knocked it down by about 80%!

You might want to read https://github.com/romkatv/zsh-bench if you
haven't already. Don't miss
https://github.com/romkatv/zsh-bench#deferred-initialization in
particular. The tl;dr is that deferred initialization is almost always
a bad idea. I'm being cautious with "almost" here. I don't actually
know of any use cases where deferred initialization is the right

> The down-side is that the terminal exits if the first input is <enter>, but works fine if any command is executed.

Never seen this. Can you post the smallest zshrc that reproduces this problem?

> How can I inject a command for the first line, e.g. "/usr/bin/clear" in order to jerry-rig this to work?

It's too early to attempt workarounds. There might be a way to fix the
underlying problem.


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