hostname in PS1 cannot be set by the init signal as that occurs before /etc/profile, which overrides PS1
Also, clean up some code to not try to change PS1, but just change HOSTNAME
Added `hostname --update` to update $HOSTNAME by reading /etc/hostname again
notable changes
### TTY
New /lib/tty library that provides the core readKeyboard and drawText functionality. /lib/term should still be used by user code and the tty api should be considered alpha. The intent in this separation of the code is to allow term api to remain unchanged and allow tty to adapt as improvements are made.
### delayloaded and now splitting
The delayloaded packaging system has been removed. The delayload system allowed for library object to appear loaded when in fact they were not. But this significantly increased boot time. The code now imploys "library splitting", saves tremendous memory, shortens boot time, and all libraries are fully usable even when partially loaded. In other words, it is all transparent to the user.
### boot memory cost
Numerous micro optimizations have been made. "boot to shell prompt" now idles at 156k allocated, or 40k free, up from ~26k free before this change. Yes, that's 14k less in this update.
.shrc -p: show dir slash by default
event registration was incorrectly calling timers and unregistering
term handler for enter key fixed to use code instead of sym
ls fixed to respect -p for all dirs
The function object can be called to read from the stream, same usage as before
But the object also exposes the request handle userdata, to allow calling close for example:
```
local request = require("internet").request("http://www.google.com")
print(request()) -- same as before
request:close() -- clean up resources now, as opposed to waiting for gc
```
closes#2255
reduced memory cost to boot to shell!
READONLY mount option added: `mount -r ...`
os.execute (and shell.execute) now correctly spawn child shells with isolated shell environment (i.e. shell env vars such as PWD do not proprogate to the parent shell) Note that require("sh").execute(env, command, ...) is an option for direct command execution if dirtying the current shell is desired. Note that /bin/source uses sh.execute for this purpose
/dev/components added with smart adapters and links
supported devfs components at this time:
computer, internet, filesystem, screen, gpu, modem, eeprom
components can be labeled with /bin/label
/dev/components/by-label respects component labels
/etc/udev/rules.d/ supports boot labels
* component labeling and udev rules should be considered experiemental
links can now be relative
devfs significantly simplified, api reduced to single create method
various code cleanup
/bin/cp and /bin/mv hardened and now share common code
multiple fs mount point now share appropriate meta data (e.g. links)
hardened fs library
fs now detects and appropriately handles link cycles (a->b->a)
grep fix: show multiple matches with -o
install .prop added support for "ignore" key, for floppies to NOT be detected as an install source candidate. If you have a floppy and you don't want install to list it for install options, add {ignore=true} in a .prop file
less and more call cat when there is no tty (e.g. piped via |)
ln can create relative links
pwd -P option added to show real path
a messy term gpu resize issue fixed where the gpu can change resolution before the terminal is able to handle the resize event
smart hinting (where single hint results can extend to the next set) has been improved and put in shared code: now shell has it not just lua shell
text stream reader/writer now supports unicode as well as binary mode, e.g. writing binary data to /dev/eeprom now fixed