Skip to content

GrayHatter/hsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 (what could 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 agent than you standard POSIX shell. It's less of an instance, of a shell, and much closer to a system shell. E.g. when you add an alias in one instance, it becomes available on all instances as well. Changing a setting in one, updates it across all1.

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
zig build
./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

Footnotes

  1. 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.