News for hackers. Stuff that matters.
Re:My Windows Computer Just Doesn't Feel Like Mine Anymore by sandreas on Saturday June 22, 2024 @05:30AM (#40757646)
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 :-)

There are no comments on this comment yet.