Live data from Hacker News

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

starship.rs

71–80 of 216 posts

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

#71

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.

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 just run git status manually, I always explicitly specify the branch when I do anything that touches a remote, everything else you can undo if you have to.

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

#72

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.

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.

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

#73
I know Starship isn't zsh specific but I guess its tangentially related, does anyone know what the default zsh config is on MacOS? I got quite used to it, and now I'm on linux I'd like to replicate it. The closest I've got is using the eastwood theme on oh-my-zsh but it's not quite the same (I dont even think MacOS using oh-my-zsh out the box, but its got all the nice git stuff)

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

#74
post #35

Earlier quoted context omitted.

Starship is very fast, taking only a couple of milliseconds to gather the data (and you can easily configure it to minimise what it'll spend time gathering). It's night and day compared to other ones I've tried, where the hundred millisecond-ish delays annoyed me.

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.

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

#75

Earlier quoted context omitted.

Why the timestamps are that important? Honestly asking. You can always time your commands with "time".

When you’re debugging, especially a complex system, especially during an outage or postmortem, understanding when your commands executed relative to when your log lines appeared is really helpful.

That's a poor and hacky substitute of using Linux audit features. It's perhaps the right robustness/complexity trade off for my personal machine, but for work they likely already have audit features turned on and you can access the timing from there.

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

#76
Ignore the haters - I too am a fan of minimalism in my terminal since I don't appreciate unnecessary clutter or decoration, but context is king and Starship can be configured as such.

By default my prompt is a shows me the current directory, the time, and a single character '%'. If I set something in my environment for which I need to be contextually aware - i.e if I have KUBECONFIG or OS_CLOUD - then the prompt is updated with the detail. Similar for languages - it'll automatically show me the version of Go or Python or whatever based on a few factors, all of which I can control.

The reason I love Starship is that it's made all this very, very easy to configure - instead of having to wade through arcane Zsh configuration or additional plugins, Starship makes it easy. It also adds negligible overhead to initialisation, especially when done so via evalcache [0]

[0] https://github.com/mroth/evalcache

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

#77

Atuin and Starship the same Day on place 1? Next zellij :)

I can't imagine interacting with computers without fzf, zoxide and nix anymore; everything else feels relatively inconsequential Wondering if there are any other life-changing tools I'm missing out on...

I've got a whole list of tools you might want to consider checking out over at [1]. The scripts themselves are Ubuntu specific, but the binaries are ones I've all found very helpful over the years.

In particular I'd call out `gron` (make JSON greppable) and `lnav` (Datadog-level log filtering but for local machines and files) as very helpful for dev work.

[1]: https://github.com/hiAndrewQuinn/shell-bling-ubuntu?tab=read...

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

#79
post #58

Earlier quoted context omitted.

I literally use just PS1='$ '. `git status` to know git stuff. `pwd` for the current working directory, etc I also don't use aliases like `gs` or `..` One good thing about having a very minimal setup is that you feel at home anywhere. It wasn't always like this. I used many, many prompts and shell tools over the decades. The only tool that stood the test of time is tmux.

See when I don't have a prompt I forget to run those things and just autopilot through a lot of commands before I realize Im on the wrong branch. For example if I have say 3 worktrees open in 3 seperate tmux tabs and are context switching between them (very common when reviewing multiple PRs from my devs) Sometimes i will get the tabs mixed up, which worktree is where etc and just autopilot a bunch of commands meant…

On tmux, I use split panels more often than tabs.

Usually, there will be from 2 to 8 panels of different sizes.

This gives me spacial short term memory: I know what each shell is by the panel position.

I can zoom on then to bring them full screen (ctrl+b z) if I'm going to do anything that requires more space, then zoom out to the panel arrangement when I'm done.

Sometimes I'll name prompts (eg `PS1='stg$ '`), specially when working with ssh, but that's rare.

What inspired me to work this way was this video on the acme editor: https://www.youtube.com/watch?v=dP1xVpMPn8M

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

#80
post #31

Earlier quoted context omitted.

I like stuffing everything which might be important to the context window in there, personally. Saving 50ms on the prompt load sure beats a false negative when something goes wrong because I don't even think to ask whether I have the wrong Node version installed or something.

Yes. I show the python or node version of currently active venv and venv name. Also, I somehow worked in special characters for Python and other things that get screwed up if I don’t have the right nerd font installed on the system.

How often are you switching these things that you need their values in sight at all times though?

Even for cases where I need to use old versions, I don’t need a reminder of that every time I run a command.

Post reply on HN