Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shell aliases #357

Merged
merged 13 commits into from
Jun 26, 2022
Merged

Add shell aliases #357

merged 13 commits into from
Jun 26, 2022

Conversation

vinc
Copy link
Owner

@vinc vinc commented Jun 20, 2022

No description provided.

@vinc
Copy link
Owner Author

vinc commented Jun 26, 2022

Example of shell session:

> /tmp

> env
TZ    "7200"
DIR   "/tmp"
HOME  "/usr/vinc"

> env FOO "Hello, World!" # Set env var and shell var

> env FOO
Hello, World!

> env
TZ    "7200"
DIR   "/tmp"
HOME  "/usr/vinc"
FOO   "Hello, World!"

> print $FOO
Hello, World!

> set foo "Hi there" # Set shell var

> alias p "print"

> p $foo
Hi there

> unset foo # Unset shell var

> unset FOO # Unset env var and shell var

> unalias p # Remove command alias

TODO: env will have to be reimplemented as a builtin command to set shell variables, and $DIR is not yet an env var.

@vinc
Copy link
Owner Author

vinc commented Jun 26, 2022

Some aliases are present in /ini/shell.sh but commented out to offer an experience closer to Unix. This would add ls /tmp instead of list /tmp or it's alias l /tmp for example.

Some commands could also be removed, for example list /tmp is equivalent to read /tmp, the only differences being the error message when trying to read a file or device, and automatically listing the current directory when invoked without arguments. Another case is goto /tmp, aliased to g /tmp and go /tmp that has a shorter equivalent with simply /tmp. And finally quit with its alias q have become the main way to quit a program so exit could be moved to the Unix compatibility aliases because the shortcut e is already taken by edit.

@vinc vinc marked this pull request as ready for review June 26, 2022 07:58
@vinc vinc merged commit 82882ec into trunk Jun 26, 2022
@vinc vinc deleted the feature/shell-aliases branch June 26, 2022 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant