Technical Background of Interactive CLI of Ruby 2.7¶ ↑
Abstract¶ ↑
Ruby 2.7 will be released with new multiline IRB that uses a new input library Reline. I'll talk about the technical background of it.
-
the history of terminal
-
the Morse code
-
typewriter
-
teletype
-
escape sequence
-
escape sequence on Unix like OS
-
Windows support
-
-
GNU Readline compatible features
-
editing modes
-
inputrc that is a setting file
-
-
I8n support
-
too many character encodings in the world
-
Unicode's complex tweaked specifications
-
…it's very difficult to understand for non-CJK people so I'll try to explain it by emoji
-
-
Details¶ ↑
the history of terminal¶ ↑
The history of terminal that we're using daily started from hundreds of years ago. It was constructed by coded signals, typing system, and printing system. It was extended with complex printing system and escape sequence to control it. The protocol and its specifications are the base of “terminal” of computer today.
GNU Readline compatible features¶ ↑
GNU Readline has so many features that include emacs like editor, vi like editor, TTY controls, settings file, and macro. I'll talk about how I implemented it almost completely.
I8n support¶ ↑
There are so many character encodings in the world, especially in CJK due to historical reasons. All terminal applications must treat the characters correctly. But it's not easy to implement.
And Unicode has so complex specifications of “character”, it's constructed by codepoints, combining characters, and glue codepoints. It's very difficult to understand for non-CJK people so I'll try to explain it all by emoji.