In addition, honour the maximum number of history buffers allowed when creating new ones. Some implementation information has been obtained from https://github.com/microsoft/terminal (under MIT License).