6 ms·
If anyone is interested in developing a shell even further, checkout rustyline[0]. It makes it very simple to add keyboard shortcuts (Ctrl-C), completion, and e
by noahster11 8y ago
If anyone is interested in developing a shell even further, checkout rustyline[0]. It makes it very simple to add keyboard shortcuts (Ctrl-C), completion, and even history.
There's also liner[1], which is part of the redox-os project, which also has a lot of the same features.
[0]: https://github.com/kkawakam/rustyline https://github.com/kkawakam/rustyline
[1]: https://github.com/redox-os/liner https://github.com/redox-os/liner
- JoshMcguigan 8y agoI'd second the recommendation for rustyline. I played around with it a bit while reviewing the rush[0] project, another shell implemented in Rust for learning purposes. [0]: https://github.com/psinghal20/rush https://github.com/psinghal20/rush
- laumars 8y agoctrl+c (as well as ctrl+\ and ctrl+z) is a little different from other shortcuts because they're captured by your TTY rather than your running application - though you can catch the interrupt that ctrl+c et al sends. Lesser known fact: you can also redefine which keys you want to raise SIGINT, SIGQUIT and SIGTSTP with.
- Cursuviam 8y agoI second this greatly! Too many people roll their own line editors and always mess up the readline (emacs) shortcuts.
- laumars 8y agoI rolled my own and didn't even bother with emacs shortcuts (got vim ones though, as that's what I'm familiar with). However I'm not adverse adding emacs shortcuts if anyone can recommend a good guide for which keys do what.
- Cursuviam 8y agoBash shortcut guides get most of the useful ones. https://github.com/fliptheweb/bash-shortcuts-cheat-sheet https://github.com/fliptheweb/bash-shortcuts-cheat-sheet
- laumars 8y agoUseful link (thank you) but to be honest I was after a more complete list because nothing breaks usability more than something being familiar but not behaving quite the same exactly. But I'll stop being a lazy arse and Duck Duck Go the answer myself :)