Live data from Hacker News

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

starship.rs

201–210 of 216 posts

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

#201
post #170

With or without starship, one problem I have with zsh prompts is that when I press Enter, there is still a visible delay where for a fraction of a second, the cursor moves to the beginning of the next line. This makes a nasty "flashing" effect. If I keep Enter pressed, the cursor is permanently visible at offset 0 in the lowest line. If the prompt is ultra-fast (e.g. plain root shell prompt on zsh), it happens less (…

Try tweaking kitty's input_delay setting. For example: kitty --override=input_delay=10

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

#202

Earlier quoted context omitted.

I only switch branches manually too, but I work in many repos and come back to stuff after days sometimes.

"git status" is all you need then.

Then you have to remember to run this regularly. Which i regularly forget in tmux autopilot mode. The prompt serves as one last headsup reminder. Even then sometimes I dont look at it and have to roll some stuff back

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

#203
post #65
post #46

Earlier quoted context omitted.

That was the same thing that drove me to find an alternative and I also landed on ohmyposh specifically because starship lacked the transient prompt.

I'm not 100% sure what a transient prompt is, but it looks like Starship now might have support for them. [right prompt docs] https://starship.rs/advanced-config/#enable-right-prompt [transient prompt docs] https://starship.rs/advanced-config/#transientprompt-and-tra...

https://starship.rs/advanced-config/#transientprompt-in-powe...

Starship only supports this in PowerShell for whatever reason.

Edit: Doh. I see what you linked to now. Yea, maybe it does work in more than just PowerShell now?

Transient prompt basically removes your prompt decorations and replaces it with just `>` in your scroll back history in your shell sessions. In my case it's a slightly more complex transient prompt (datetime and exit code of the command), but still greatly simplified.

Makes cut-and-paste of history in to docs and stuff super nice.

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

#204

Earlier quoted context omitted.

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…

If you do not have any subshells or command substitutions in your PS1, then you also save alot of time on platforms like WSL, where forks are expensive.

My earliest background as a shell user was as as system administrator (back in "the day", let's say), and forks are always potentially expensive, and often the reason you're opening a shell session in the first place (to diagnose resource contention or exhaustion, for example). There have been lots of times when one more fork is too much to take. (Which also, yes, makes it "interesting" to figure out what you can run in your shell session, too).

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

#205

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…

A non-forking prompt command is an absolute requirement for me and always has been, so I did this in pure shell. It's not a lot of code but it's a little tricksy.

If I still used bash, starship would be a non-starter for me, in part, since it's fork/execed in the prompt command. Further up this thread someone says that the zsh installation is different and it's a native shared library that gets loaded into zsh. That seems neat.

(The other reason it's a non-starter is that maybe I can stomach sending over a dotfile to various systems, but selecting a platform-specific native binary is too much configuration management to be done to prepare for an SSH session/kubectl exec. Eventually I made my peace with doing this for emacsclient so I could have local editing of remote files, but that's a lot less critical of a piece to miss than something that appears in your prompt. Conceptually, if you want to ship over/config-manage a native binary, you might as well install a better shell, which became a compelling argument to me when I switched to Powershell).

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

#206

It has support for fish shell... I'll pass.

support for a shell you don't use is a negative? why? I don't personally use it, but I don't mind if other people do -- what's the problem here? just curious.

Fish shell detracts from people learning (and maintaining) to use POSIX compliant shell scripting. Professionals should be ready at a moments notice to use bash, zsh, and ksh. Also good to be familiar with a csh, (I would accept tcsh). Learn to use the tools of the trade, not toys.

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

#207

I live in the terminal, so I wrote my own prompt ages ago when I started learning Go[1][2], and before that I had a simple prompt in bash. I like to keep things very simple and fast, so the directory and the git branch is all I need. I wonder if people really use all that information or if they set it up thinking they need it, but then never do. [1]: https://git.sr.ht/~jamesponddotco/gosh [2]: I should probably updat…

I like the host you have that code on. That's refreshing to see a website that doesn't _require_ you to run some javascript.

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

#208

Too bad that we still use text based shells in the year 2025. We should have come up with a graphical shell that is as powerful and flexible two decades ago.

What's a graphical shell in your mind if you don't mind me asking?

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

#209

Earlier quoted context omitted.

I don't use aliases, but abbreviations that expand to the actual full command. Helpful to type less and history has the exact.

I like this. What do you use to accomplish this?

I don’t know exactly what they’re referencing, but Zsh has something like that where you can expand eg filenames and paths from this unique bits.

So if you have

``` src/components/Button.vue src/components/ButtonGroup.vue ```

And you type `nvim s/c/G` it’ll expand to the second file’s path.

Post reply on HN