Wrap up a couple writes to a single

This commit is contained in:
Bryan Ashby 2017-09-02 09:53:12 -06:00
parent 52405a2f51
commit d3a6ce8645
1 changed files with 8 additions and 2 deletions

View File

@ -136,13 +136,19 @@ exports.MenuModule = class MenuModule extends PluginModule {
}
beforeArt(cb) {
let initSeq = '';
if(_.isNumber(this.menuConfig.options.baudRate)) {
// :TODO: some terminals not supporting cterm style emulated baud rate end up displaying a broken ESC sequence or a single "r" here
this.client.term.rawWrite(ansi.setEmulatedBaudRate(this.menuConfig.options.baudRate));
initSeq += ansi.setEmulatedBaudRate(this.menuConfig.options.baudRate);
}
if(this.cls) {
this.client.term.rawWrite(ansi.resetScreen());
initSeq += ansi.resetScreen();
}
if(initSeq) {
this.client.term.rawWrite(initSeq);
}
return cb(null);