Use \027[H\027[J to reset the terminal in Lua (for now), as \027c produces bogus characters and does not clear the terminal.
Details
Details
- Reviewers
kevans manu tsoome - Group Reviewers
Contributor Reviews (src)
echo "end" > /boot/lua/local.lua shutdown -r now ... Type '?' for a list of commands, 'help' for more detailed help. OK printc("\027c") ?cOK
Evidently, that is not what we want. As a workaround:
OK printc("\027[H\027[J")
Almost works (does not reset the colors), but is better than what we currently have.
OK boot
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
A lot depends on which terminal emulator you are on.
KEYSTR_RESET is defined to be ESCAPE c in the standards. Most terminal emulators get this right. It also resets attributes and other things that the clear screen sequence that you propose does not.
Given the diversity of terminal emulators in the wild, I'd be quite hesitant to make this change...
Comment Actions
You are right, I should have specified this originally.
Given the diversity of terminal emulators in the wild, I'd be quite hesitant to make this change...
Can we have _both_ clearing methods? I can propose a different revision then.
Thanks!