Live data from Hacker News

Starship: A minimal, fast, and customizable prompt for any shell

starship.rs

91–100 of 216 posts

Re: Starship: A minimal, fast, and customizable prompt for any shell

#91
post #15

every time your shell takes 100ms to render git status that you didn’t even need, you're paying invisible tax on flow. terminals should be reactive memory tools, not passive decoration. we optimize for code runtime but not for our own typing latency

Could prompt tools like this use TUI-style features to edit the displayed prompt after releasing it back to the user? So if kubectl, git, or aws cli takes 200ms to finish it doesn't matter, the data from the output of these commands will appear a few moments after the prompt has been released to the user, so the user doesn't feel like they're waiting for the prompt to be ready.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#92
post #15

every time your shell takes 100ms to render git status that you didn’t even need, you're paying invisible tax on flow. terminals should be reactive memory tools, not passive decoration. we optimize for code runtime but not for our own typing latency

The delay is certainly frustrating. I use a patched version of kitty terminal that moves starship prompt to the bottom of the window, similar to vim and emacs. Since modeline updates are asynchronous, the shell prompt is very snappy even in big git repos. The downside is that you have to patch kitty and I never bothered to test my personal pet project on anything else than Linux.

https://github.com/mbachry/kitty-modeline

Re: Starship: A minimal, fast, and customizable prompt for any shell

#93
post #32

Earlier quoted context omitted.

For personal workstation, the current directory is enough. Maybe I change the color based the status of the last command. That’s pretty much the only information I need before entering any command. Everything else can be accessed when I really need it.

Problem is you can't get timestamps and run times of your commands 'when you really need it', unlike almost everything else

As an alternative, perennial HN recommendation atuin (https://atuin.sh) logs time, duration and exit code (among other data) for every command.

That way you only have to look at it when you need it, and you can also figure out what you were doing last week/month/year if necessary.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#94
post #72

Earlier quoted context omitted.

You don't need to know what branch you're on before running commands? I cant tell you the number of times ive been on the wrong branch executing stuff.

I'm highly aware of which branch I'm on. Because it's because I don't use any scripts or automation that switches branches; I only ever switch branches manually so I have that awareness.

How well does this work when you work on multiple repos with longer pauses inbetween?

And the Branch is also an unintrusive reminder that you are in a path under versioncontrol.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#95

Earlier quoted context omitted.

Depends a lot on the system. I tried using it on Windows via MSYS2, and it seems like some Windows overhead (maybe process startup?) was causing Starship to slow it all down to a crawl. Disabling a few of the addons helped but didn't fix it. In the end I stopped using it.

I don't know if Windows can be helped. It may be antivirus but I feel like 50th percentile load time is at least a second and there's nothing to be done about it. git just hangs sometimes on git show/git diff. I have to kill the terminal.

My experience of Starship on Windows has been great. I'm using the Windows native builds of both Starship and git (both installed/updated via winget these days) in PowerShell.

I try to avoid emulation layers like MSYS2, as much as I'm able.

Also, yes, if git hangs on git show/git diff that sounds like an antivirus problem or a dying hard drive or the first one causing the other one.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#96
post #15

every time your shell takes 100ms to render git status that you didn’t even need, you're paying invisible tax on flow. terminals should be reactive memory tools, not passive decoration. we optimize for code runtime but not for our own typing latency

counter-point: having to constantly track git status in your head, and needing to type commands to remind yourself, is a far bigger distraction. Optimize to avoid context switching, not for a few ms latency.

FWIW, I switched from zsh default to starship and didn't notice any perceptible difference. But I certainly notice when I mess up my git commits!

Re: Starship: A minimal, fast, and customizable prompt for any shell

#97
post #15

every time your shell takes 100ms to render git status that you didn’t even need, you're paying invisible tax on flow. terminals should be reactive memory tools, not passive decoration. we optimize for code runtime but not for our own typing latency

> we optimize for code runtime but not for our own typing latency

Don't the layers of frameworks mean that the opposite is true.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#98

Earlier quoted context omitted.

I personally use a modified zbell (in zsh) to give me a notification when a command finishes after 30 seconds, and send me an email if it takes over 2 minutes.

I generally use Konsole's "notify when program exits" feature. For longer tasks, I have a small tool which I pipe to, and it sends me push notification with the output (if I prefer).

I had a tool I'd pipe to, but I'd often only think about it after I'd realize that the command was going to take a while. A push notification sound cool; I used email because I knew how to hack it together with curl.

Here's one zbell implementation, not sure it's the original but it looks like it does the trick: https://gist.github.com/oknowton/8346801

Re: Starship: A minimal, fast, and customizable prompt for any shell

#99
post #55

I like how minimal prompts keep focus, but adding just the right context like AWS profile or last command status really saves time and mistakes. Starship hits a good balance here.

The one thing I'd miss from my prompt if I went full $ is the hostname. And even with it in there, I still f it up sometimes.

Re: Starship: A minimal, fast, and customizable prompt for any shell

#100

Does the speed of your shell matter? Surely the speed of the programs that you're running through your shell matter more. I've never been let down by how fast bash can tell a program to start running EDIT: oh, i misunderstood, its just the prompt at the start of your shell... I dont think ive ever been annoyed at how fast that renders either

Some people like to put, for example, their current git branch in the prompt. To get that means at least naively, running a git command on every single line the prompt renders on. Git is fast, but it's easy to add a bunch of these and suddenly your prompt takes 100ms to render. Hit enter a few times and you'll immediately notice lag. For that reason, doing this fast does make a real difference. Of course the fastest…

> Git is fast, but it's easy to add a bunch of these and suddenly your prompt takes 100ms to render.

Or maybe many seconds if you have network drives over a slow VPN connection - not working on network drives, just having them connected. Fun to diagnose when you need to get urgent work done while traveling.

Post reply on HN