4 ms·
Editing the current line works because I brought in https://man7.org/linux/man-pages/man3/readline.3.html https://man7.org/linux/man-pages/man3/readline.3.html
by healeycodes 7mo ago
Editing the current line works because I brought in https://man7.org/linux/man-pages/man3/readline.3.html https://man7.org/linux/man-pages/man3/readline.3.html towards the end so I could support editing, tab completion, and history.
IIRC readline uses a `char *` internally since the length of a user-edited line is fairly bounded.
- austy69 7mo agoVery cool. Currently working on the beginning of a small text editor so this part seemed interesting and was curious of any overlap. Thanks for the interesting post!
- zokier 7mo agoworth noting that you get basic line editing for "free" from kernels tty subsystem even if you don't use readline.
- 1718627440 7mo agoYes, but it is really basic. Is it more than backspace? Most cursor key presses are just forwarded to the program as escape sequences.