panel 1: editing text you typed in seems so basic: >>> print("helo") oops, forgot an l! but there's actually no standard system panel 2: programs need to implement even the most basic things person: "left arrow" program: "ok I will move the cursor to the left" often programs will use the readline library for this option 1: NOTHING person (angry): "even the ARROW KEYS don't work???" program: arrow keys? what's that? * Only `Ctrl-W` `Ctrl-U` and backspace work * Examples: cat, nc, git * You're probably in this situation if you press the left arrow key and it prints `^[[D` * You can often add readline shortcuts with `rlwrap`, like this: $ rlwrap nc option 2: READLINE person (neutral): "it's a little awkward but at least I can use those weird keyboard shortcuts from emacs!" * LOTS of keyboard shortcuts: `Ctrl-A` `Ctrl-E` , arrow keys, many more * You can use Ctrl-R to look at history * Examples: bash, irb, psql * If you press `Ctrl-R` and you see "reverse-i-search" , you're probably using readline * Configurable with the `~/.inputrc` config file option 3: CUSTOM person (smiling): "wow, I can type a multiline command without it being a total disaster?? amazing!" * The keyboard shortcuts are probably influenced by readline * Examples: fish, zsh, ipython * usually you only see custom implementations in bigger projects
https://cdn.masto.host/socialjvnsca/media_attachments/files/113/448/641/150/204/338/original/a1852af41fbc4323.png