Skip to content

v0.6.0 β€” moshcode pwd 🀘

Choose a tag to compare

@ralyodio ralyodio released this 12 Jul 23:44
· 371 commits to main since this release

🎸 moshcode v0.6.0 β€” where am I?

New read-only moshcode pwd (alias where; TUI: /pwd). Shows the current directory and, when you're inside a git repo, the repo name + branch, root, and origin:

~/src/moshcode
repo:   moshcode (main)
root:   ~/src/moshcode
origin: https://github.com/moshcoder/moshcode.git
  • Zero-dependency β€” reads the .git dir directly instead of spawning git, so it works even without git on $PATH.
  • Walks up to the nearest .git and requires a readable HEAD, so a stray/invalid .git dir (e.g. /tmp/.git) is never mistaken for a repo.
  • Handles worktree/submodule .git files (gitdir: …) and detached HEAD (short sha). $HOME collapses to ~.