zsh-users
 help / color / mirror / code / Atom feed
* Injecting a command into stdin / input
@ 2022-09-08  1:26 Zach Riggle
  2022-09-08  2:52 ` Lawrence Velázquez
  2022-09-08  6:24 ` Roman Perepelitsa
  0 siblings, 2 replies; 3+ messages in thread
From: Zach Riggle @ 2022-09-08  1:26 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

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%!

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

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

*Zach Riggle*

[-- Attachment #2: Type: text/html, Size: 699 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Injecting a command into stdin / input
  2022-09-08  1:26 Injecting a command into stdin / input Zach Riggle
@ 2022-09-08  2:52 ` Lawrence Velázquez
  2022-09-08  6:24 ` Roman Perepelitsa
  1 sibling, 0 replies; 3+ messages in thread
From: Lawrence Velázquez @ 2022-09-08  2:52 UTC (permalink / raw)
  To: Zach Riggle, Roman Perepelitsa; +Cc: zsh-users

On Wed, Sep 7, 2022, at 9:26 PM, Zach Riggle wrote:
> I've been doing some rather ridiculous things with zsh-defer [1]

Looks like you forgot the link.

https://github.com/romkatv/zsh-defer

> in order to speed up my shell startup time.  I've knocked it down by
> about 80%!
>
> The down-side is that the terminal exits if the first input is <enter>, 
> but works fine if any command is executed.
>
> How can I inject a command for the first line, e.g. "/usr/bin/clear" in 
> order to jerry-rig this to work?

Perhaps Roman can provide some advice, as he is the author of
zsh-defer.  (I know he's subscribed to this list, but I've Cc-ed
him for expediency.)

-- 
vq


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Injecting a command into stdin / input
  2022-09-08  1:26 Injecting a command into stdin / input Zach Riggle
  2022-09-08  2:52 ` Lawrence Velázquez
@ 2022-09-08  6:24 ` Roman Perepelitsa
  1 sibling, 0 replies; 3+ messages in thread
From: Roman Perepelitsa @ 2022-09-08  6:24 UTC (permalink / raw)
  To: Zach Riggle; +Cc: Zsh Users

On Thu, Sep 8, 2022 at 3:27 AM Zach Riggle <zachriggle@gmail.com> 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
solution.

> 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.

Roman.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-08  6:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08  1:26 Injecting a command into stdin / input Zach Riggle
2022-09-08  2:52 ` Lawrence Velázquez
2022-09-08  6:24 ` Roman Perepelitsa

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).