siliconlad / aish

A terminal shell built with AI at the core
6 stars 0 forks source link

Add Tilde Expansion #90

Closed siliconlad closed 1 month ago

siliconlad commented 1 month ago

This was a pain in the ass because of edge-cases like

> echo ~/Documents
/home/siliconlad/Documents
> echo ~Documents
~Documents
> export FOO=BAR && echo ~$FOO
~BAR
> export FOO=BAR && echo ~/$FOO
/home/siliconlad/BAR
siliconlad commented 1 month ago

If you're confused about the Group token, it's basically a container for anything split by one of the following dividers >, <, >>, ;, &&, ' '. It also joins the items within a group into a single argument before passing it to the command. This allows detecting arguments like hi$FOO.

siliconlad commented 1 month ago

The Lexer needs a refactor me rekons: https://github.com/siliconlad/aish/issues/91