Live data from Hacker News

Starship.rs: minimal, fast prompt for any shell

starship.rs

51–60 of 160 posts

Re: Starship.rs: minimal, fast prompt for any shell

#51

Earlier quoted context omitted.

Git information is extremely useful to me. I notice colleagues who don't have that tend to struggle using git on the command line and use git status nearly every other command (much as I tend to do when I'm remoting into a shell with a plain prompt). Python venvs are useful too if you have a shell for running the program and other shells that just happen to be within that directory.

It's probably a bell curve and you're only seeing the left side.

Huh? What here is a bell curve? What would be on the "right side" of the bell curve that invalidates the idea that git info in PS1 is useful?

Re: Starship.rs: minimal, fast prompt for any shell

#52
post #14

Earlier quoted context omitted.

Maybe read through the documentation and try it out. It has very robust configuration options, many pre-built modules that are ready to include in your prompt, for example, one that prints git info for the current location if it's a repository. So yes, it is kind of a competitor to p10k, but not zsh. It's just the prompt, and it just focuses on being a very good prompt tool.

Yeah, it's just a prompt replacement that does all the things that your prompt already does, but it's written in Rust.

Have you tried writing a PS1 which shows all the info that's demonstrated on the linked page?

I have. It's a decent chunk of work. It's a whole lot more work to do it well. Did you remember to handle the situation where the git repo is so gigantic that running `git status` takes half a minute? Or the case where there is a .git folder somewhere but permissions are wrong or it crosses a mount barrier so `git status` prints a page of text to stderr? Does the way you're finding the current branch handle the case where HEAD doesn't point to a branch?

The only way your prompt "already does" this stuff is if you've spent a whole lot of time configuring it and tuning it, or if you're already using something like oh-my-zsh. And if you're already using something like oh-my-zsh, well, starship is just a competitor to (the prompt portion of) that.

Re: Starship.rs: minimal, fast prompt for any shell

#53
post #32

The "minimal" part is a little funny. Historical minimal shell prompts: $ # % >

I think a huge amount of these prompts are just fiddling with things because people think they are clever, not because they are actually useful. My prompt for years has been: : ▶ I add the hostname if it’s an SSH session and change ▶ to # if I’m root because those are both important contexts that should be omnipresent, but aside from that, I haven’t felt like I’m missing anything at all. The CWD is in the window / ta…

[flagged]

Re: Starship.rs: minimal, fast prompt for any shell

#54
If you use home-manager, installing starship is as simple as adding `programs.starship.enable = true;`.

https://github.com/srid/nixos-config/blob/master/home/starsh...

Incidentally, starship also gives a visual indication of whether you are in the nix shell or not, which is pretty handy when using direnv:

https://nixos.asia/en/direnv

Re: Starship.rs: minimal, fast prompt for any shell

#55
post #28

Is there a Unicode symbol for source branch used there? Not really keen on using some specific fonts just for that. I usually use simple ^ but having something like there would be nicer.

There is a new (soon to be default) preset which doesn’t use extra fonts. Also, any symbol can be overridden using the config file.

Re: Starship.rs: minimal, fast prompt for any shell

#60

Installed it yesterday and it threw my email and AWS default region on to the prompt. Pretty bad defaults. Promptly removed it.

it’s trivial to configure fwiw. with as much info as it is capable of showing it’s a stretch to think it’ll magically know what you want.

My problem is not that it didn’t do what I want, just that it seems to work in a “opt in to everything by default” which was overwhelming. I prefer things that without config don’t do anything or do the bare minimum and then lets me slowly add to it.
Post reply on HN