summaryrefslogtreecommitdiffstats
path: root/dist
Commit message (Collapse)AuthorAgeFilesLines
* Split OS-specific run commands into a different fileRory Dudley2024-08-092-6/+7
| | | | | | | | Do not run certain commands, except on specific operating systems, when calling the global run command file. This allows users to avoid having unaliases and unsets in their user-defined rc file (~/.dwvshrc). Signed-off-by: Rory Dudley <rory@netc.lu>
* Alias grep to always use colorRory Dudley2024-05-201-0/+3
| | | | | In the global /etc/dwvshrc file, alias grep so that it always displays with color by default.
* Add support for aliases to the `which` commandRory Dudley2024-04-041-0/+3
| | | | | | The `which` command is not necessarily a builtin, however, it can display shell aliases. This patch adds a line into dist/etc/dwvshrc, which allows /usr/bin/which to detect our shell aliases, and print them.
* Use $PS1 for the promptRory Dudley2024-03-301-0/+4
| | | | | Instead of passing a hard-coded value for the prompt, use $PS1. The default is '|> ', set in dist/etc/dwvshrc.
* Remove hard-coded PATHRory Dudley2024-03-281-0/+3
Use $PATH, instead of a hard-coded PATH from main(). This means that there is no longer a need to pass around PATH to repl()/recite()/path::refresh(), since path::refresh() can call env::var directly. Since the hard-coded paths were removed, there needs to be some way to define $PATH. When running the debug build, dwvsh will look in 'dist/etc/dwvshrc' for the initial environment setup. For the release target, dwvsh will look in '/etc/dwvshrc'. After the global rc file is sourced, dwvsh will try to source ~/.dwvshrc if it exists, so users can extend their environment without root access (assuming a release install). Notes: Throughout a lot of this program, we're calling `env!("HOME")`, in order to get the user's home directory. Technically, this is not correct. The env!() macro resolves environment variables during compile time, while env::var() gets environment variables for the running process (i.e. the shell). See https://users.rust-lang.org/t/env-vs-env-var/88119 for more info. In the near future, this will need to be addressed. Might be worth looking into what other shells do, though one idea I had was to invoke '/usr/bin/id', grab the user's ID, and use it to grab the rest of the info from /etc/passwd. This would be handled in an /etc/dwvlogin or /etc/dwvprofile most likely.