From ec2f6af1d00b9ec7dcfc4e4478c488f2c06ac2ba Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Mon, 28 Mar 2022 14:41:12 -0500 Subject: [PATCH] More code review fixes --- core/menu_module.js | 2 +- core/theme.js | 4 ++-- misc/config_template.in.hjson | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/menu_module.js b/core/menu_module.js index 54bda2c7..94331e6d 100644 --- a/core/menu_module.js +++ b/core/menu_module.js @@ -509,7 +509,7 @@ exports.MenuModule = class MenuModule extends PluginModule { this.optionalMoveToPosition(position); - return theme.displayThemedPause(this.client, position, cb); + return theme.displayThemedPause(this.client, {position}, cb); } promptForInput( { formName, formId, promptName, prevFormName, position } = {}, options, cb) { diff --git a/core/theme.js b/core/theme.js index f574c62f..52ce243c 100644 --- a/core/theme.js +++ b/core/theme.js @@ -585,8 +585,8 @@ function displayThemedPrompt(name, client, options, cb) { return callback(null, promptConfig, artInfo); } - if(options.row != null) { - artInfo.startRow = options.row; + if(!_.isNil(options) && !_.isNil(options.position) && !_.isNil(options.position.row)) { + artInfo.startRow = options.position.row; if(client.term.termHeight > 0 && artInfo.startRow + artInfo.height > client.term.termHeight) { // in this case, we will have scrolled artInfo.startRow = client.term.termHeight - artInfo.height; diff --git a/misc/config_template.in.hjson b/misc/config_template.in.hjson index a4dc0c9b..5b51b43a 100644 --- a/misc/config_template.in.hjson +++ b/misc/config_template.in.hjson @@ -73,6 +73,12 @@ // during the connect process, but provides better autoconfiguration of utf-8 checkUtf8Encoding : true + // Checking the ANSI home position also requires the use of cursor position reports, which are not + // supported on all terminals. Using this with a terminal that does not support cursor position reports + // results in a 3 second delay during the connect process, but works around positioning problems with + // non-standard terminals. + checkAnsiHomePosition: true + // other options here include cp437TermList and utf8TermList, see config_default.js for more information }