srctree

commits New Issue Suggest Diff

hsh

8 branchesadd 2nd make stack test for failing command 2 months ago0a98153c
README.md

hsh

~~Don't use this, it's not ready!~~You probably don't want to use this yet, but it's my current default shell (whatcould go wrong) so it might work for you if you're brave enough.

Current technological breakthrough => "counting"

Hash is a slightly different take on your shell. It's closer to a user agentthan you standard POSIX shell. It's less of an instance, of a shell, and muchcloser to a system shell. E.g. when you add an alias in one instance, it becomesavailable on all instances as well. Changing a setting in one, updates it acrossall[^ephem].

[^ephem]: There ~~is~~ will eventually be an ephemeral mode to allow any instance to have it's own settings without affecting your other shells on the system.

Goals

  • Support *modern* pttys
  • Composable vs decomposable mode
  • Less than 1h to migrate from any $SHELL (still considering reverts as well)
  • cd should not exec any payloads

[De]composable mode

A default, unconfigured install of hsh should enable all features and functionality. Running hsh non-interactive, or [other] should disable all helful, or context aware features unless explicitly enabled.

Requirements

Compilation requires zig 0.12.0 or greater.

Install

git clone https://srctree.gr.ht/repo/hsh<br>zig build<br>./zig-out/bin/hsh

or zig build -p /usr/ if you're brave enough to install into /usr/bin/hsh

Tests can be run with zig build test

TODO

  • basic parsing
  • .hshrc support
  • exec
  • friendly exec
  • && success
  • || failures
  • ; cmd
  • IoRedir
  • | func
  • > std clobber
  • >> std append
  • 2> err clobber
  • 2>&1 err to out
  • < in
  • << here-doc;
  • tab complete
  • cwd
  • path
  • subdirs
  • basic fuzzy search
  • narrow fuzzy search
  • ~, and glob
  • the rest?
  • history
  • advanced history
  • sane error handling
  • complex parsing
  • context aware hints
  • HSH builtins
  • builtin
  • pipeline
  • help
  • show
  • state
  • status
  • POSIX builtins
  • alias
  • bg
  • cd
  • popd
  • colon
  • date
  • die
  • disown
  • dot
  • echo
  • eval
  • exec
  • exit
  • export
  • fg
  • jobs
  • kill?
  • pwd
  • read
  • set
  • shift
  • source
  • unalias
  • unset
  • wait
  • the rest?
  • globs
  • simple globs
  • recursive globs
  • enumerated globs (name.{ext,exe,md,txt})
  • script support?
  • logic (if, else, elif, case)
  • if
  • elif
  • else
  • while
  • for
  • case
  • loops (for, while)
  • env
  • real path support
  • debugging configuration

notes

(zig build run does some magic that causes hsh to segv)

Contributors

@SteampunkEngine