Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


For me the AWS integration is nice. That way I know what account I'm on, and what region among my dozens of windows.

For example:

    …/.config master on AWS_Prod (use2)
starship.toml:

    [aws]
    format = 'on [($profile )(\($region\) )]($style)'
    style = 'bold #B23D2F'
    symbol = " "  <- cloud symbol
    [aws.region_aliases]
    us-east-1 = 'use1'
    us-east-2 = 'use2'


Oh ya, for work the kubeconfig integration is absolutely essential, i bounce between local clusters and shared nonprod clusters all the time and while its not an outage to break the nonprods its going to annoy a lot of people so its nice to know which one is active.


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.


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


Even if I know my current branch, having my prompt show me untracked/uncommitted/unpushed changes helps to identify if something didn’t work because I’m in a dirty state, or if something I ran (unexpectedly) caused a dirty state.

For example, I don’t expect running scripts/build.sh to modify tracked files in the repo. Seeing part of the prompt go from “” to “?2!3” (two untracked, three changed files) makes that glaringly obvious.


"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


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.


not op, but if I haven’t been in a working directory for a while, I always run `git status` anyway. Then I know the branch and any out of date files. I usually run `git pull —-rebase` and get everything back up to date. I try not to leave broken branches around, so It’s rare that knowing which branch I’m on is an issue.


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.


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.


Same here. I definitely went through a powerline, alias, huge vimrc, etc phase, but it turns out just sticking to the base toolset is pretty handy.

I can sit down at (or ssh into) any machine and be basically just as productive, and it also turns out that I just always want to know more than nicely fits into the prompt anyways.

There's something to be said for accepting the defaults of a tool, and learning to use them well. Customization is powerful, but... I think most times it's not the right call until you're already an expert in the tool at hand.


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 for one tree into a different one and its quite annoying to clean up.

The prompt has generally stopped me from doing that.


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


"The only tool that stood the test of time is tmux."

tmux comes from BSD rather thsn GNU/Linux, or Windows

What is the default shell in OpenBSD

starship does not support it

   starship init ksh

   ksh is not yet supported by starship.
   For the time being, we support the following shells:
   * bash
   * elvish
   * fish
   * ion
   * powershell
   * tcsh
   * zsh
   * nu
   * xonsh
   * cmd

   Please open an issue in the starship repo if you would like to see support for ksh:
   https://github.com/starship/starship/issues/new


Same here, I also find that aliases for speed introduce unnecessary complexity and mental overhead later on. It's not much, and for other people it doesn't matter or they have a different preference, but that's what I prefer.

Sort of contrary to that I really enjoy the maximalist shells. A computer should be fun to use!


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<Tab>` it’ll expand to the second file’s path.


I guess it depends on your day job and workflow?

I’m a researcher and work on small projects with 1-3 people (most of the time it’s just me prototyping stuff alone). I then tend to work on a branch for weeks at a time, so the git branch provides very little information compared to the space it takes in a prompt.

If I was switching branches every 5min, it would be useful.


As a complete aside, and not to argue with you at all: I think it might change your life to take a good look at jj. I just mention this to try to be helpful to you.


oh-my-zsh default prompt mode for git branches is for me! super clean. need to familiarize myself with some more of their shorthand commands.


Manual git status is enough for me.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: