I get this error after a while (seems append doesn't close the file each time):
std.file.FileException@std/file.d(836): history.txt: Too many open files
auto jm_addToHistory(T...)(T args) {
import std.conv : text;
import std.file : append;
auto txt = text(args);
append("history.txt", txt);
return txt;
}