sh
sh copied to clipboard
cmd/gosh: add basic readline functionality
gosh is not meant to replace a full interactive shell, but it would still be nice to have the basics like being able to use the arrow keys to run previous commands.
This should be pure Go, so perhaps https://github.com/peterh/liner would do.
@mvdan I'm using your library as a shell in an experimental Linux(ish) OS I'm building where the Init, and all Userland are written in Go. As such, would it be possible to handle some typical key-bindings like ^L for clearing the screen?
Looks like the liner package would do the trick nicely 👌
Happy to accept PRs for this :)
Worth noting that u-root have a modified version of gosh now as well, and they seem to use their own interactive prompt package: https://github.com/u-root/u-root/blob/HEAD/cmds/core/gosh/gosh.go