Skip to content

Basic implementation of less.

Jeremy Soller requested to merge MovingtoMars:less into master

Created by: MovingtoMars

This PR adds a basic implementation of the less command.

Note that displaying text from standard input is not yet supported, because in that case the terminal input is not the same as stdin, so it needs a way to open the terminal input separately to handle keypresses.

Also, lines longer than the terminal width are not cleanly handled. They simply overflow onto the next terminal line, and are then overwritten by the next line's contents. In order to handle them cleanly, termion needs a way to query the current cursor position. Without this feature, there is probably no way to implement long lines without non-standard width characters (eg. 東京) breaking it.

Merge request reports