Live data from Hacker News

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

starship.rs

111–120 of 216 posts

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

#112

Earlier quoted context omitted.

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.

Or just a really big git repo. Starship includes a timings command, on linux (with an annoying antivirus meddling) this is what I see against one directory:

    git_status  -   6ms  -   "[!?] "
    directory   -   4ms  -   " "
    python      -   3ms  -   "via  v3.12.9 (.venv) "
    character   -   in "
If I go in to my checked out version of the linux kernel, probably the biggest git project I've got kicking around:

    git_status  -  115ms  -   ""
    directory   -    4ms  -   "linux "
    character   -    in "
That's typically the worst I see it.

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

#114

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

I've tried tools in this space which add hundreds of milliseconds to a shell's start-up time. That's easily noticeable, especially when the system is under heavy load.

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

#115

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…

Even 'git status' gets slow on large repositories (or slow hosts).

git status takes 643ms for github.com/rust-lang/rust

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

#117
post #53
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 100ms optimization is a lot different for a CPU or a human brain. I'm not defending having the entire system log dumped out on every prompt but a few amenities are worth a few milliseconds computation time for a human. Besides, I don't see how, for example , having your prompt take those 100ms to print a git branch or status breaks your "flow" yet having…

100 ms is an incredibly long time even for humans.

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

#118

Genuine question for all the people putting timestamps in your prompts: do you never look at your command history and see that they’re all timestamped?

Per the Bash `history` manpage:

    int history_write_timestamps
       If non-zero, timestamps are written to the history file, so they can be preserved between sessions.  The default value is 0, [...]
So this isn't true by default on many machines unless it is explicitly turned on.

I could find no command line history for Bash when I poked around. I use the fish shell, however, which does embed timestamp data by default - but I rarely think to look there when the detail might be pertinent. C'est la vie.

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

#119

Genuine question for all the people putting timestamps in your prompts: do you never look at your command history and see that they’re all timestamped?

I do know that though that assumes some things about os and shell. Run a full screen term on my machine for a good chunk of my workflow and I just like to have time and battery in my term. I render it as ‘(15:35) [80} $ ‘ and for boxes without batteries it’s just ‘(15:35) $ ‘ Some times I’ll go back through my scroll back and look at the time when I’m trying to figure things out. Or when I run a command that generate…

I think we’re quite similar I just put my time display in the tmux status bar :)

Just so I am clear, use your prompts as you see fit — I’m just trying to understand how others work. Thanks!

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

#120

Genuine question for all the people putting timestamps in your prompts: do you never look at your command history and see that they’re all timestamped?

It's a different use case. If you run a slow command and check terminal later, you can see how long it took.
Post reply on HN