joachimschmidt557 / linenoize

A port of linenoise to zig
MIT License
55 stars 9 forks source link

some improvements #4

Closed fogti closed 2 years ago

fogti commented 2 years ago

Cache some syscalls (and env check) and declare default values in an imo better way.

Justification for caching: these values change really rarely, but one of them introduces a syscall, which makes strace's of programs using this a bit more annoying to read. I also think that allowing the user to override them is a good idea (in case the user encounters additional broken terminals but doesn't want to patch this package).

The last changed section is mostly a style change, but I found this variant easier to understand.

joachimschmidt557 commented 2 years ago

Merged in 6ecf4550bc42df76f4b8de7df188093530f1c8c2 and eace1d09eef4f68cca2043707d718dc84fb88183.