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

PS sucks so I've always installed git bash and used it instead since I first discovered it ~12y ago

Starship seems quite promising, this is the first time I'm seeing it. But I'm a bit confused on how it works, can you go into a bit more details?

Can I use starship+ps to get all Unix and git tools or should I stick with my existing workflow with windows git bash?



Besides git bash you could also use wsl, like in:

  wsl ls -lsa
  wsl cat file.txt

Basically, starship is a config generator for your shell. It transforms a cross platform config file (starship.toml) into a platform specific configuration shell script, e.g.:

  starship init zsh
will output something like

  zmodload zsh/parameter  # Needed to access jobstates variable for STARSHIP_JOBS_COUNT

  # Defines a function `__starship_get_time` that sets the time since epoch in millis in STARSHIP_CAPTURED_TIME.
  if [[ $ZSH_VERSION == ([1-4]*) ]]; then
    # ZSH <= 5; Does not have a built-in variable so we will rely on Starship's inbuilt time function.
    __starship_get_time() {
        STARSHIP_CAPTURED_TIME=$(/home/andreas/bin/starship time)
    }
  else
    zmodload zsh/datetime
    zmodload zsh/mathfunc
    __starship_get_time() {
        (( STARSHIP_CAPTURED_TIME = int(rint(EPOCHREALTIME * 1000)) ))
    }
  fi
  # ...
  # ...
For PowerShell the output will look accordingly - the config stays the same. I've had a bunch of custom zsh / powershell config dotfiles for years now, starship just eases it out :-)


Starship is just a fancy prompt that just happens to be crazy cross-platform (works on Linux, MacOS, and Windows shells), but it's super-informative, and easy to install/configure. Beyond that, you'll still need to choose a shell you prefer for when you want/need to use a terminal/console window for things. Contrary to popular belief, the shell is not obsolete by a longshot, even on Windows. On Windows, PowerShell is probably gonna be your best bet, as it's the current standard going forward. I use Starship on Fish shell on Linux and love it.


powershell is light years easier than bash. like, im fluent in bash enough to get stuff done, but i only got there over years, while i picked up powershell fairly quickly. also wayyyyy more readable.

i'll admit the object vs text thing is annoying, i feel like bash is more straightforward there, but PS will let you do the same thing eventually.


My experience is almost exactly inverted. WTF is Invoke? Am I a sorcerer? I want to call a function, I think…


I would have thought Microsoft on is dotnet multi-platform journey would find a way to make PowerShell just POSIX compatible, supporting at least standard all day commands like `grep`, `wc`, `find` and others. All it would have taken is to create aliases or replacements for the top 50 shell commands.

Instead they re-invented the wheel. It's not a bad wheel, but the wheel is completely different than most people would expected to be and for POSIX enthusiast it just does not feel right.

With wsl or git bash you can do this but it feels slow and clunky most of the time.


Have you tried MSYS2? It even uses pacman for package management!




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

Search: